PropertyChangedCallback PropertyChangedCallback PropertyChangedCallback PropertyChangedCallback Delegate

定義

依存関係プロパティの有効なプロパティ値が変更されたときに呼び出されるコールバックを表します。Represents the callback that is invoked when the effective property value of a dependency property changes.

public delegate void PropertyChangedCallback(DependencyObject ^ d, DependencyPropertyChangedEventArgs e);
public delegate void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e);
type PropertyChangedCallback = delegate of DependencyObject * DependencyPropertyChangedEventArgs -> unit
Public Delegate Sub PropertyChangedCallback(d As DependencyObject, e As DependencyPropertyChangedEventArgs)

パラメーター

d
DependencyObject DependencyObject DependencyObject DependencyObject

プロパティの値が変更された DependencyObjectThe DependencyObject on which the property has changed value.

e
DependencyPropertyChangedEventArgs DependencyPropertyChangedEventArgs DependencyPropertyChangedEventArgs DependencyPropertyChangedEventArgs

このプロパティの有効値に対する変更を追跡するイベントによって発行されるイベント データ。Event data that is issued by any event that tracks changes to the effective value of this property.

継承
PropertyChangedCallbackPropertyChangedCallbackPropertyChangedCallbackPropertyChangedCallback

次の例では、をPropertyChangedCallback指定するシグネチャを使用して、新しい依存関係プロパティを登録します。The following example registers a new dependency property, using the signature that specifies a PropertyChangedCallback. 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)
  )
);
Public Shared ReadOnly AquariumGraphicProperty As DependencyProperty = DependencyProperty.Register("AquariumGraphic", GetType(Uri), GetType(AquariumObject), New FrameworkPropertyMetadata(Nothing, FrameworkPropertyMetadataOptions.AffectsRender, New PropertyChangedCallback(AddressOf OnUriChanged)))
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
  Shape sh = (Shape) d;
  sh.Fill = new ImageBrush(new BitmapImage((Uri)e.NewValue));
}
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

拡張メソッド

GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

指定したデリゲートによって表されるメソッドを表すオブジェクトを取得します。Gets an object that represents the method represented by the specified delegate.

適用対象