AmbientAttribute Class

Updated: July 2008

Specifies that a property should be treated as ambient.

Namespace:  System.Windows.Markup
Assembly:  WindowsBase (in WindowsBase.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml

[AttributeUsageAttribute(AttributeTargets.Property, Inherited = true)]
public sealed class AmbientAttribute : Attribute
<AmbientAttribute .../>

An ambient property is a property where the value must be available in the parser context to objects that exist as child objects in an object tree. In other words, an ambient property is used regardless of whether that property is present as a member on all classes that participate in a given ambient interaction. The primary WPF scenario for this is when properties set on the parent are used to qualify values in child object property values. For instance, a property of the Style (TargetType) can qualify the necessary property name lookups that are needed to find the backing references for strings set in Property.

This attribute is applied to the property itself, not the owning class.

System.Object
  System.Attribute
    System.Windows.Markup.AmbientAttribute

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2

Date

History

Reason

July 2008

Added topic for new class.

SP1 feature change.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft