我下一依賴性特性:依賴屬性如何工作?
public static DependencyProperty RequestObjectProperty = DependencyProperty.Register("RequestObject", typeof(RegistrationCardSearch), typeof(RegCardSearchForm),new UIPropertyMetadata(Changed));
private static void Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
MessageBox.Show("Property Changed!!!");
}
public RegistrationCardSearch RequestObject
{
get
{
return (RegistrationCardSearch)GetValue(RequestObjectProperty);
}
set
{
SetValue(RequestObjectProperty, value);
}
}
和「改變」方法,有火的時候,我的依賴屬性的變化。我的屬性類型是RegistrashionCardSearch(類)。當我改變依賴屬性中的類的屬性值時,Property改變了回調而不是被觸發。爲什麼??我的RegistrashionCardSearch類實現INotifePropertyChanged接口