Bewerken

Delen via


XamlMember.IsAmbient Property

Definition

Gets a value that indicates whether this XamlMember is reported as an ambient property.

public:
 property bool IsAmbient { bool get(); };
public bool IsAmbient { get; }
member this.IsAmbient : bool
Public ReadOnly Property IsAmbient As Boolean

Property Value

true if this XamlMember is reported as an ambient property; otherwise, false.

Remarks

Calling IsAmbient invokes LookupIsAmbient or a specific override of that method. This behavior occurs in implementations where the initial internal reflection logic has not already set the information.

Checking for ambient properties is are usually part of XAML processing logic to make sure that objects and values that rely on ambient usage for type qualification can function correctly. The .NET Framework XAML Services APIs and the default XAML schema context populates this value based on attribution with AmbientAttribute. The default implementation of LookupIsAmbient uses this existing AmbientAttribute technique, and it returns true if AmbientAttribute exists on a member declaration.

AmbientAttribute is found on members of several WPF types, which include Application, Setter, and Style. It is also found on the ResourceDictionary type, which connotes that any member that uses ResourceDictionary as its type should be considered ambient even if the member is not specifically attributed.

Applies to

See also