This documentation is archived and is not being maintained.

AmbientAttribute Class

Updated: July 2008

Specifies that a property should be treated as ambient.

Namespace:  System.Windows.Markup
Assembly:  WindowsBase (in WindowsBase.dll)

[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.


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




July 2008

Added topic for new class.

SP1 feature change.