DefaultValue Property
Collapse the table of content
Expand the table of content

PropertyMetadata.DefaultValue Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the default value for the dependency property.

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

public Object DefaultValue { get; }

Property Value

Type: System.Object
The default value for the dependency property.

If you need to know the type of the value, you can either call typeof() on the value or use reflection to get PropertyInfo from the CLR wrapper of the dependency property.

In Windows Phone, you cannot reset a default value for a dependency property once it is registered.

The default value for a dependency property is often not the apparent value at run time, even if the property is not explicitly set.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft