Esporta (0) Stampa
Espandi tutto

Classe FrameworkPropertyMetadata

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

Spazio dei nomi: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)
Spazio dei nomi XML:  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

I membri statici pubblici (Shared in Visual Basic) di questo tipo sono validi per le operazioni multithreading. I membri di istanza non sono garantiti come thread safe.

Microsoft .NET Framework 3.0 è supportato in Windows Vista, Microsoft Windows XP SP2 e Windows Server 2003 SP1.

.NET Framework

Supportato in:

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft