FrameworkPropertyMetadata Class

Definition

Reports or applies metadata for a dependency property, specifically adding framework-specific property system characteristics.

public class FrameworkPropertyMetadata : System.Windows.UIPropertyMetadata
Inheritance
FrameworkPropertyMetadata

Examples

The following example gets metadata for a dependency property on a particular owner as the initial base PropertyMetadata type. That metadata is cast to FrameworkPropertyMetadata. If the cast returned a valid FrameworkPropertyMetadata, then various FrameworkPropertyMetadata property values are reported through a simple UI (not shown).

pm = dp.GetMetadata(dp.OwnerType);
pm = dp.GetMetadata(dp.OwnerType)
FrameworkPropertyMetadata fpm = pm as FrameworkPropertyMetadata;
if (fpm!=null) {
    AffectsArrange.Text = (fpm.AffectsArrange) ? "Yes" : "No";
    AffectsMeasure.Text = (fpm.AffectsMeasure) ? "Yes" : "No";
    AffectsRender.Text = (fpm.AffectsRender) ? "Yes" : "No";
    Inherits.Text = (fpm.Inherits) ? "Yes" : "No";
    IsDataBindingAllowed.Text = (fpm.IsDataBindingAllowed) ? "Yes" : "No";
    BindsTwoWayByDefault.Text = (fpm.BindsTwoWayByDefault) ? "Yes" : "No";
}         
Dim fpm As FrameworkPropertyMetadata = TryCast(pm, FrameworkPropertyMetadata)
If fpm IsNot Nothing Then
	AffectsArrange.Text = If((fpm.AffectsArrange), "Yes", "No")
	AffectsMeasure.Text = If((fpm.AffectsMeasure), "Yes", "No")
	AffectsRender.Text = If((fpm.AffectsRender), "Yes", "No")
              [Inherits].Text = If((fpm.Inherits), "Yes", "No")
	IsDataBindingAllowed.Text = If((fpm.IsDataBindingAllowed), "Yes", "No")
	BindsTwoWayByDefault.Text = If((fpm.BindsTwoWayByDefault), "Yes", "No")

Remarks

This class derives from PropertyMetadata (through UIPropertyMetadata) . For most WPF framework-level application development purposes, FrameworkPropertyMetadata is the type used for dependency property metadata, rather than the base metadata types PropertyMetadata or UIPropertyMetadata. This is true both for existing dependency properties and for most custom dependency property scenarios.

The members declared by this class that supplement the PropertyMetadata base class include various Boolean properties that specify or report WPF framework-level property system behavior such as property inheritance, data binding, and layout.

Several constructor signatures for creating a FrameworkPropertyMetadata instance take a FrameworkPropertyMetadataOptions parameter. The FrameworkPropertyMetadataOptions enumeration is used only to specify initial behavior in the constructor, and is not otherwise exposed after FrameworkPropertyMetadata is constructed. From a constructed instance, you can get or set the corresponding information through various properties that share the name of the enumeration values used in the constructor call.

XAML Text Usage

This class is not typically used in XAML.

Constructors

FrameworkPropertyMetadata()

Initializes a new instance of the FrameworkPropertyMetadata class.

FrameworkPropertyMetadata(Object)

Initializes a new instance of the FrameworkPropertyMetadata class with the specified default value.

FrameworkPropertyMetadata(PropertyChangedCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework-level metadata options.

FrameworkPropertyMetadata(Object, PropertyChangedCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the specified callbacks.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified PropertyChangedCallback callback.

FrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified callbacks.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified callbacks.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, specified callbacks, and a Boolean that can be used to prevent animation of the property.

FrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback, Boolean, UpdateSourceTrigger)

Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, specified callbacks, a Boolean that can be used to prevent animation of the property, and a data-binding update trigger default.

Properties

AffectsArrange

Gets or sets a value that indicates whether a dependency property potentially affects the arrange pass during layout engine operations.

AffectsMeasure

Gets or sets a value that indicates whether a dependency property potentially affects the measure pass during layout engine operations.

AffectsParentArrange

Gets or sets a value that indicates whether a dependency property potentially affects the arrange pass of its parent element's layout during layout engine operations.

AffectsParentMeasure

Gets or sets a value that indicates whether a dependency property potentially affects the measure pass of its parent element's layout during layout engine operations.

AffectsRender

Gets or sets a value that indicates whether a dependency property potentially affects the general layout in some way that does not specifically influence arrangement or measurement, but would require a redraw.

BindsTwoWayByDefault

Gets or sets a value that indicates whether the property binds two-way by default.

DefaultUpdateSourceTrigger

Gets or sets the default for UpdateSourceTrigger to use when bindings for the property with this metadata are applied, which have their UpdateSourceTrigger set to Default.

Inherits

Gets or sets a value that indicates whether the value of the dependency property is inheritable.

IsDataBindingAllowed

Gets a value that indicates whether data binding is supported for the dependency property.

IsNotDataBindable

Gets or sets a value that indicates whether the dependency property supports data binding.

Journal

Gets or sets a value that indicates whether this property contains journaling information that applications can or should store as part of a journaling implementation.

OverridesInheritanceBehavior

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.

SubPropertiesDoNotAffectRender

Gets or sets a value that indicates whether sub-properties of the dependency property do not affect the rendering of the containing object.

Methods

Merge(PropertyMetadata, DependencyProperty)

Enables a merge of the source metadata with base metadata.

OnApply(DependencyProperty, Type)

Called when this metadata has been applied to a property, which indicates that the metadata is being sealed.

Equals(Object) Inherited from Object
Equals(Object, Object) Inherited from Object
GetHashCode() Inherited from Object
GetType() Inherited from Object
MemberwiseClone() Inherited from Object
ReferenceEquals(Object, Object) Inherited from Object
ToString() Inherited from Object
CoerceValueCallback Inherited from PropertyMetadata
DefaultValue Inherited from PropertyMetadata
IsSealed Inherited from PropertyMetadata
PropertyChangedCallback Inherited from PropertyMetadata
IsAnimationProhibited Inherited from UIPropertyMetadata

Applies to

See Also