Represents the callback that is invoked when the effective property value of a dependency property changes.
Namespace:
System.Windows
Assembly:
WindowsBase (in WindowsBase.dll)
Visual Basic (Declaration)
Public Delegate Sub PropertyChangedCallback ( _
d As DependencyObject, _
e As DependencyPropertyChangedEventArgs _
)
Dim instance As New PropertyChangedCallback(AddressOf HandlerMethod)
public delegate void PropertyChangedCallback(
DependencyObject d,
DependencyPropertyChangedEventArgs e
)
public delegate void PropertyChangedCallback(
DependencyObject^ d,
DependencyPropertyChangedEventArgs e
)
JScript does not support delegates.
In XAML, you can use delegates but you cannot define your own.
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(
"AquariumGraphic",
typeof(Uri),
typeof(AquariumObject),
new FrameworkPropertyMetadata(null,
FrameworkPropertyMetadataOptions.AffectsRender,
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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0
Reference
Other Resources