Editar

Compartilhar via


FrameworkPropertyMetadata.OverridesInheritanceBehavior Property

Definition

Gets or sets a value that indicates whether the property value inheritance evaluation should span across certain content boundaries in the logical tree of elements.

public:
 property bool OverridesInheritanceBehavior { bool get(); void set(bool value); };
public bool OverridesInheritanceBehavior { get; set; }
member this.OverridesInheritanceBehavior : bool with get, set
Public Property OverridesInheritanceBehavior As Boolean

Property Value

true if the property value inheritance should span across certain content boundaries; otherwise, false. The default is false.

Exceptions

The metadata has already been applied to a dependency property operation, so that metadata is sealed and properties of the metadata cannot be set.

Remarks

This metadata reports a seldom-applied modification to property value inheritance behavior across special parent element-child element boundaries. The canonical example of such a boundary is the contents of a Frame, where the Frame content might get reloaded independently of the existence of the Frame. The desired property system behavior is that property value inheritance should not traverse into the contents of the Frame, because these contents might be elements that the application hosting the frame does not own or control. Specifying metadata with OverridesInheritanceBehavior set to true, as well as specifying Inherits as true, will cause the property on which the metadata is applied to be inheritable even across the Frame boundary or similar boundaries.

Properties on derived classes of PropertyMetadata are typically defined in the object model as read-write. This is so they can be adjusted after initialization of the instance. However, after the metadata is consumed as part of a call to Register, AddOwner, or OverrideMetadata, the property system will seal that metadata instance and properties that convey the specifics of the metadata are now considered immutable. Attempting to set this property after IsSealed is true on this metadata instance will raise an exception.

XAML Text Usage

Members of this class are not typically used in XAML.

Applies to

See also