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)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

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

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.Object
   System.Windows.PropertyMetadata
     System.Windows.UIPropertyMetadata
      System.Windows.FrameworkPropertyMetadata

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft