Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PropertyMetadata Class


Defines certain behavior aspects of a dependency property as it is applied to a specific type, including conditions it was registered with.

Namespace:   System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)


public class PropertyMetadata


Initializes a new instance of the PropertyMetadata class.


Initializes a new instance of the PropertyMetadata class with a specified default value for the dependency property that this metadata will be applied to.

System_CAPS_pubmethodPropertyMetadata(Object, PropertyChangedCallback)

Initializes a new instance of the PropertyMetadata class with the specified default value and PropertyChangedCallback implementation reference.

System_CAPS_pubmethodPropertyMetadata(Object, PropertyChangedCallback, CoerceValueCallback)

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


Initializes a new instance of the PropertyMetadata class with the specified PropertyChangedCallback implementation reference.


Gets or sets a reference to a CoerceValueCallback implementation specified in this metadata.


Gets or sets the default value of the dependency property.


Gets 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.


Gets or sets a reference to a PropertyChangedCallback implementation specified in this metadata.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodMerge(PropertyMetadata, DependencyProperty)

Merges this metadata with the base metadata.

System_CAPS_protmethodOnApply(DependencyProperty, Type)

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


Returns a string that represents the current object.(Inherited from Object.)

Property metadata can be defined and used during dependency property registration when calling the Register method (or variations for attached properties or read-only dependency properties), or after original owner registration when calling the OverrideMetadata method. AddOwner also takes property metadata.

This class is a concrete base class that can be used in each of these calls. However, it is very common to specify metadata using one of the derived classes such as FrameworkPropertyMetadata. These derived classes support more detailed metadata carried as Boolean property values, which are useful for either detecting or enabling some property system and layout behaviors that are only implemented at the WPF framework level.

Several properties of this class are read-write to the object model, but can only be written prior to the instance being used in a property system operation such as Register or OverrideMetadata. Each of these properties could also have been set by the constructor but are exposed so that Merge method implementations can set them.

This type, and members of this type, are not typically used in XAML.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0

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

Return to top
© 2017 Microsoft