Re-evaluates the effective value for the specified dependency property
Assembly: WindowsBase (in WindowsBase.dll)
Calling on a property that has its local value set will have no effect, because the local value takes precedence over other property system inputs, except for animations. However, you could call ClearValue, then call . For more information, see Dependency Property Value Precedence.
Calling is not necessarily applicable for many dependency property scenarios. If a dependency property becomes invalidated because of value changes in any of the constituents, the property system invalidates and re-evaluates the dependency property automatically. However, there are still some appropriate scenarios where is useful. In particular, you can use inside the coerce value or property changed callback for a different dependency property. You can also use to force re-evaluation of a binding against a data source that is not able to implement the recommended INotifyPropertyChanged notification mechanism (perhaps if consuming data classes that cannot be derived from, or where the data is a static member).
The following example calls on a custom property, whenever properties that are involved in the invalidated property's calculations change. This is an alternative technique to calling the CoerceValue method, because invalidating the property will also call any registered CoerceValueCallback.
Shared Sub New() WidthProperty.OverrideMetadata(GetType(AreaButton), New FrameworkPropertyMetadata(New PropertyChangedCallback(AddressOf InvalidateAreaProperty))) HeightProperty.OverrideMetadata(GetType(AreaButton), New FrameworkPropertyMetadata(New PropertyChangedCallback(AddressOf InvalidateAreaProperty))) End Sub Private Shared Sub InvalidateAreaProperty(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs) d.InvalidateProperty(AreaProperty) End Sub
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.