DependencyPropertyChangedEventArgs.OldValue property

Applies to Windows and Windows Phone

Gets the value of the dependency property before the reported change.


public object OldValue { get; }

Property value

Type: System.Object [.NET] | Platform::Object [C++]

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.

A PropertyChangedCallback implementation is an optional part of the property metadata that you provide when you register a dependency property. The callback is invoked by the dependency property system internally. For more info on dependency properties in general, see Custom dependency properties and Dependency properties overview.


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]


Windows::UI::Xaml [C++]



See also

Dependency properties overview



© 2014 Microsoft