DependencyPropertyChangedEventHandler delegate

Applies to Windows and Windows Phone

Represents the method that will handle events that occur when a DependencyProperty is changed on a particular DependencyObject implementation.

Syntax


public delegate void DependencyPropertyChangedEventHandler(
  object sender, 
  DependencyPropertyChangedEventArgs e
)

Attributes

[Version(0x06020000)]
[WebHostHidden()]

Parameters

sender

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

The source of the event (typically the object where the property changed).

e

Type: DependencyPropertyChangedEventArgs

The event data.

Remarks

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

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

Metadata

Windows.winmd

See also

PropertyChangedCallback
DependencyPropertyChangedEventArgs
Control.IsEnabledChanged
Custom dependency properties

 

 

Show:
© 2014 Microsoft