在代码中经常见到这个接口,它里面有什么?它的作用是什么?它和依赖属性有什么关系?

下面就来总结回答这三个问题。

1.这个INotifyPropertyChanged接口里就一个PropertyChanged的event,这个接口其实是从.net 2.0就引入进来的,用它实现观察者模式很是方便。

#region Assembly System.dll, v4.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll
#endregion

namespace System.ComponentModel
{
    // Summary:
    //     Notifies clients that a property value has changed.
    public interface INotifyPropertyChanged
    {
        // Summary:
        //     Occurs when a property value changes.
        event PropertyChangedEventHandler PropertyChanged;
    }
}
View Code

相关文章:

  • 2021-05-20
  • 2022-03-09
  • 2021-10-04
  • 2022-01-05
  • 2022-12-23
  • 2021-10-07
  • 2021-06-20
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2022-01-14
  • 2022-01-03
  • 2022-12-23
  • 2021-09-06
相关资源
相似解决方案