DependencyPropertyChangedEventArgs.OldValue Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the value of the dependency property before the reported change.
public:
property Platform::Object ^ OldValue { Platform::Object ^ get(); };
IInspectable OldValue();
public object OldValue { get; }
var object = dependencyPropertyChangedEventArgs.oldValue;
Public ReadOnly Property OldValue As Object
The dependency property value before the change.
The OldValue value is often used as the value that the property is set to from within the callback, in case the NewValue value is not considered a valid value for your property's logic . For example, if you are using the callback for validation of an input value for a property that the user can set in UI, the previous value is typically a better value to use as the current value rather than resetting the value to a default. The callback is effectively canceling a change.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |