DependencyPropertyChangedEventHandler 委托

定义

表示将处理某些事件的方法,这些事件在特定的 DependencyProperty 实现上的 DependencyObject 发生更改时引发。Represents the method that will handle events raised when a DependencyProperty is changed on a particular DependencyObject implementation.

public delegate void DependencyPropertyChangedEventHandler(System::Object ^ sender, DependencyPropertyChangedEventArgs e);
public delegate void DependencyPropertyChangedEventHandler(object sender, DependencyPropertyChangedEventArgs e);
type DependencyPropertyChangedEventHandler = delegate of obj * DependencyPropertyChangedEventArgs -> unit
Public Delegate Sub DependencyPropertyChangedEventHandler(sender As Object, e As DependencyPropertyChangedEventArgs)

参数

sender
Object

事件源。The source of the event.

e
DependencyPropertyChangedEventArgs

事件数据。The event data.

继承
DependencyPropertyChangedEventHandler

注解

此委托是报表依赖属性更改的特定事件的处理程序签名。This delegate is the handler signature for particular events that report dependency property changes.

使用此处理程序的事件作为公共语言运行时 (CLR)common language runtime (CLR)事件而不是路由事件公开。An event that uses this handler is exposed as a 公共语言运行时 (CLR)common language runtime (CLR) event, not as a routed event. 通常, 这些事件遵循命名模式Is( PropertyName)Changed, 其中PropertyNameDependencyProperty.Name更改的属性的。Typically these events follow the naming pattern Is(PropertyName)Changed, where PropertyName is the DependencyProperty.Name of the property that changed. 事件的参数用于查询特定事件报告的属性的旧值和新值。The arguments of the event are used to query the old and new value of the property, as reported by the particular event. 通常, 发生更改的属性与报告更改的特定事件之间存在1:1 的对应关系。Typically there is a 1:1 correspondence between properties that change and a particular event that reports the change. 还可以将相同的事件报告更改为多个属性, 但这种情况很常见。It is also possible, though uncommon, to have the same event report changes to more than one property. 在这种情况下DependencyPropertyChangedEventArgs , 应检查以确定已更改的属性。In this case, the DependencyPropertyChangedEventArgs should be checked to determine the property that changed.

事件数据类DependencyPropertyChangedEventArgs的使用比只是此委托更广泛。The event data class DependencyPropertyChangedEventArgs has a wider usage than just this delegate. DependencyPropertyChangedEventArgs还用于传递PropertyChangedCallback实现的数据 (这些实现是自定义功能和WPFWPF属性OnPropertyChanged系统的内部机制的一部分) 和虚方法 (可以重写以提供特定于类的)当对象的任何依赖项属性发生更改时通知。DependencyPropertyChangedEventArgs is also used to communicate data for PropertyChangedCallback implementations, which are part of the customization features and internals of the WPFWPF property system, and by the OnPropertyChanged virtual method, which can be overridden to provide class-specific notifications whenever any dependency property on the object changes.

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅