DependencyPropertyChangedEventHandler Delegate
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.
Represents the method that will handle events that occur when a DependencyProperty is changed on a particular DependencyObject implementation.
public delegate void DependencyPropertyChangedEventHandler(Platform::Object ^ sender, DependencyPropertyChangedEventArgs ^ e);
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(153239130, 30142, 17561, 129, 128, 29, 220, 0, 84, 33, 192)]
class DependencyPropertyChangedEventHandler : MulticastDelegate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(153239130, 30142, 17561, 129, 128, 29, 220, 0, 84, 33, 192)]
public delegate void DependencyPropertyChangedEventHandler(object sender, DependencyPropertyChangedEventArgs e);
Public Delegate Sub DependencyPropertyChangedEventHandler(sender As Object, e As DependencyPropertyChangedEventArgs)
- sender
-
Object
Platform::Object
IInspectable
The source of the event (typically the object where the property changed).
The event data.
- Attributes
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
DependencyPropertyChangedEventHandler is the delegate to use when writing handlers for the Control.IsEnabledChanged event. That event is the only defined Windows Runtime event that uses this delegate.
A custom control implementer might consider using DependencyPropertyChangedEventHandler as the delegate type if a custom event is fired as a result of a dependency property value change. You can only fire such an event from within the context of a PropertyChangedCallback. This is because the value that changed (the property, the old and new value) should be in the DependencyPropertyChangedEventArgs that are reported for the event at the property-system level. But there aren't any constructors for DependencyPropertyChangedEventArgs and none of its properties are settable, so the only way to get a DependencyPropertyChangedEventArgs value is to get it from the original PropertyChangedCallback parameters and pass it through when you fire your custom event.
DependencyPropertyChangedEventHandler is not the delegate that you use for custom dependency property metadata and a custom property-changed callback behavior. For that, you want PropertyChangedCallback. For more info, see Custom dependency properties.
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 |