PropertyChangedCallback Delegate
TOC
Collapse the table of content
Expand the table of content

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
)

Parameters

d
Type: System.Windows.DependencyObject

The DependencyObject on which the property has changed value.

e
Type: System.Windows.DependencyPropertyChangedEventArgs

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 Shared ReadOnly AquariumGraphicProperty As DependencyProperty = DependencyProperty.Register("AquariumGraphic", GetType(Uri), GetType(AquariumObject), New FrameworkPropertyMetadata(Nothing, FrameworkPropertyMetadataOptions.AffectsRender, New PropertyChangedCallback(AddressOf OnUriChanged)))
Private Shared Sub OnUriChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
    Dim sh As Shape = CType(d, Shape)
    sh.Fill = New ImageBrush(New BitmapImage(CType(e.NewValue, Uri)))
End Sub

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft