NotifyPropertyChangedBase.cs 556 B

12345678910111213141516171819202122
  1. using System;
  2. using System.ComponentModel;
  3. namespace Localization
  4. {
  5. /// <summary>
  6. /// Base class implementing INotifyPropertyChanged
  7. /// </summary>
  8. public class NotifyPropertyChangedBase: INotifyPropertyChanged
  9. {
  10. public event PropertyChangedEventHandler PropertyChanged;
  11. protected void OnPropertyChanged(string name)
  12. {
  13. var handler = PropertyChanged;
  14. if (handler != null)
  15. {
  16. handler(this, new PropertyChangedEventArgs(name));
  17. }
  18. }
  19. }
  20. }