PropertyChangedCallback 대리자

정의

종속성 속성의 유효한 속성 값이 변경될 때 호출되는 콜백을 나타냅니다.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입니다.The DependencyObject on which the property has changed value.

e
DependencyPropertyChangedEventArgs

이 속성의 유효 값에 대한 변경 내용을 추적하는 이벤트에서 발급되는 이벤트 데이터입니다.Event data that is issued by any event that tracks changes to the effective value of this property.

상속
PropertyChangedCallback

예제

다음 예제에서는 지정 하는 서명을 사용 하 여 새 종속성 속성을 등록 한 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)

지정된 대리자가 나타내는 메서드를 나타내는 개체를 가져옵니다.Gets an object that represents the method represented by the specified delegate.

적용 대상