PropertyChangedCallback Delegate

Represents the callback that is invoked when the effective property value of a dependency property changes.

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)

Public Delegate Sub PropertyChangedCallback ( _
	d As DependencyObject, _
	e As DependencyPropertyChangedEventArgs _
Dim instance As New PropertyChangedCallback(AddressOf HandlerMethod)
/** @delegate */
public delegate void PropertyChangedCallback (
	DependencyObject d, 
	DependencyPropertyChangedEventArgs e
In XAML, you can use delegates but you cannot define your own.



The DependencyObject on which the property has changed value.


Event data that is issued by any event that tracks changes to the effective value of this property.

The following example registers a new dependency property, using the signature that specifies a PropertyChangedCallback. The PropertyChangedCallback is used to create a callback that changes an internal property whenever the public property changes.

public static readonly DependencyProperty AquariumGraphicProperty = DependencyProperty.Register(
  new FrameworkPropertyMetadata(null,
      new PropertyChangedCallback(OnUriChanged)

private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
  Shape sh = (Shape) d;
  sh.Fill = new ImageBrush(new BitmapImage((Uri)e.NewValue));

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0