DependencyPropertyAttribute.DefaultValue Property |
Namespace: PostSharp.Patterns.Xaml
Assembly: PostSharp.Patterns.Xaml (in PostSharp.Patterns.Xaml.dll) Version: 2023.0.3.0 (2023.0.3.0)
There are two ways to set the initial value of a dependency property when you use DependencyPropertyAttribute: You can use this property (but in that case you're limited to constants) or you can use the property initializer or set the initial value in the constructor (but in that case, the DefaultValue property will not be set).
If you set both this property and the property initializer to nonzero, nonnull values, an exception is thrown. However, you can set the metadata default value using this property and you can change the actual initial value in the constructor (not the initializer).