FrameworkPropertyMetadata Class
Reports or applies metadata for a dependency property, specifically adding framework-specific property system characteristics.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
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"; }
System.Windows.PropertyMetadata
System.Windows.UIPropertyMetadata
System.Windows.FrameworkPropertyMetadata
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.