.NET Framework Class Library for Silverlight
PropertyMetadata Constructor (Object, PropertyChangedCallback)

Initializes a new instance of the PropertyMetadata class, using a provided property default value and property changed callback reference.

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

Visual Basic (Declaration)
Public Sub New ( _
    defaultValue As Object, _
    propertyChangedCallback As PropertyChangedCallback _
)
Visual Basic (Usage)
Dim defaultValue As Object
Dim propertyChangedCallback As PropertyChangedCallback

Dim instance As New PropertyMetadata(defaultValue, _
    propertyChangedCallback)
C#
public PropertyMetadata(
    Object defaultValue,
    PropertyChangedCallback propertyChangedCallback
)

Parameters

defaultValue
Type: System..::.Object
A default value for the property where this PropertyMetadata is applied.
propertyChangedCallback
Type: System.Windows..::.PropertyChangedCallback
A reference to the callback to call for property changed behavior.
Remarks

The defaultValue for the PropertyMetadata specified as typeMetadata must be able to be typed as the type parameter, when you call Register or RegisterAttached to register a dependency property. A mismatch of types will not be noted at the time of registration, and will instead produce a run-time exception in type initialization for an instance of the owning type.

Because of the function of the Silverlight property system, the apparent value of a property (even if not locally set) is not always the default value as registered with a property's metadata. For details, see Dependency Property Value Precedence.

Do not use the value UnsetValue as the default value for a custom dependency property. UnsetValue is reserved for use as a sentinel value that participates in dependency property precedence determination.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

Tags :


Page view tracker