Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System.Windows
 PropertyChangedCallback Delegate
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
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)
Visual Basic
Public Delegate Sub PropertyChangedCallback ( _
    d As DependencyObject, _
    e As DependencyPropertyChangedEventArgs _
)
C#
public delegate void PropertyChangedCallback(
    DependencyObject d,
    DependencyPropertyChangedEventArgs e
)
Visual C++
public delegate void PropertyChangedCallback(
    DependencyObject^ d, 
    DependencyPropertyChangedEventArgs e
)
F#
type PropertyChangedCallback = 
    delegate of 
        d:DependencyObject * 
        e:DependencyPropertyChangedEventArgs -> unit

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.

Visual Basic
Public Shared ReadOnly AquariumGraphicProperty As DependencyProperty = DependencyProperty.Register("AquariumGraphic", GetType(Uri), GetType(AquariumObject), New FrameworkPropertyMetadata(Nothing, FrameworkPropertyMetadataOptions.AffectsRender, New PropertyChangedCallback(AddressOf OnUriChanged)))
C#
public static readonly DependencyProperty AquariumGraphicProperty = DependencyProperty.Register(
  "AquariumGraphic",
  typeof(Uri),
  typeof(AquariumObject),
  new FrameworkPropertyMetadata(null,
      FrameworkPropertyMetadataOptions.AffectsRender, 
      new PropertyChangedCallback(OnUriChanged)
  )
);
Visual Basic
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
C#
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
  Shape sh = (Shape) d;
  sh.Fill = new ImageBrush(new BitmapImage((Uri)e.NewValue));
}

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker