Export (0) Print
Expand All

FrameworkPropertyMetadata Class

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

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public class FrameworkPropertyMetadata : UIPropertyMetadata
This class is not typically used in XAML.

The FrameworkPropertyMetadata type exposes the following members.

  NameDescription
Public methodFrameworkPropertyMetadata()Initializes a new instance of the FrameworkPropertyMetadata class.
Public methodFrameworkPropertyMetadata(Object)Initializes a new instance of the FrameworkPropertyMetadata class with the specified default value.
Public methodFrameworkPropertyMetadata(PropertyChangedCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the specified PropertyChangedCallback callback.
Public methodFrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions)Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework-level metadata options.
Public methodFrameworkPropertyMetadata(Object, PropertyChangedCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified PropertyChangedCallback callback.
Public methodFrameworkPropertyMetadata(PropertyChangedCallback, CoerceValueCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the specified callbacks.
Public methodFrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified PropertyChangedCallback callback.
Public methodFrameworkPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and specified callbacks.
Public methodFrameworkPropertyMetadata(Object, FrameworkPropertyMetadataOptions, PropertyChangedCallback, CoerceValueCallback)Initializes a new instance of the FrameworkPropertyMetadata class with the provided default value and framework metadata options, and specified callbacks.
Public methodFrameworkPropertyMetadata(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.
Public methodFrameworkPropertyMetadata(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.
Top

  NameDescription
Public propertyAffectsArrange Gets or sets a value that indicates whether a dependency property potentially affects the arrange pass during layout engine operations.
Public propertyAffectsMeasure Gets or sets a value that indicates whether a dependency property potentially affects the measure pass during layout engine operations.
Public propertyAffectsParentArrange 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.
Public propertyAffectsParentMeasure 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.
Public propertyAffectsRenderGets 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.
Public propertyBindsTwoWayByDefault Gets or sets a value that indicates whether the property binds two-way by default.
Public propertyCoerceValueCallbackGets or sets a reference to a CoerceValueCallback implementation specified in this metadata. (Inherited from PropertyMetadata.)
Public propertyDefaultUpdateSourceTriggerGets 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.
Public propertyDefaultValue Gets or sets the default value of the dependency property. (Inherited from PropertyMetadata.)
Public propertyInherits Gets or sets a value that indicates whether the value of the dependency property is inheritable.
Public propertyIsAnimationProhibited Gets or sets a value declaring whether animations should be disabled on the dependency property where the containing metadata instance is applied. (Inherited from UIPropertyMetadata.)
Public propertyIsDataBindingAllowed Gets a value that indicates whether data binding is supported for the dependency property.
Public propertyIsNotDataBindable Gets or sets a value that indicates whether the dependency property supports data binding.
Protected propertyIsSealedGets a value that determines whether the metadata has been applied to a property in some way, resulting in the immutable state of that metadata instance. (Inherited from PropertyMetadata.)
Public propertyJournal 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.
Public propertyOverridesInheritanceBehaviorGets 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 propertyPropertyChangedCallbackGets or sets a reference to a PropertyChangedCallback implementation specified in this metadata. (Inherited from PropertyMetadata.)
Public propertySubPropertiesDoNotAffectRenderGets or sets a value that indicates whether sub-properties of the dependency property do not affect the rendering of the containing object.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMergeEnables a merge of the source metadata with base metadata. (Overrides PropertyMetadata.Merge(PropertyMetadata, DependencyProperty).)
Protected methodOnApplyCalled when this metadata has been applied to a property, which indicates that the metadata is being sealed. (Overrides PropertyMetadata.OnApply(DependencyProperty, Type).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

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);


...


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";
}         

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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