BaseViewModel.cs 741 B

123456789101112131415161718192021222324252627
  1. using System.ComponentModel;
  2. namespace MediaBrowser.UI.ViewModels
  3. {
  4. /// <summary>
  5. /// Represents a base ViewModel
  6. /// </summary>
  7. public abstract class BaseViewModel : INotifyPropertyChanged
  8. {
  9. /// <summary>
  10. /// Occurs when [property changed].
  11. /// </summary>
  12. public event PropertyChangedEventHandler PropertyChanged;
  13. /// <summary>
  14. /// Called when [property changed].
  15. /// </summary>
  16. /// <param name="name">The name.</param>
  17. public virtual void OnPropertyChanged(string name)
  18. {
  19. if (PropertyChanged != null)
  20. {
  21. PropertyChanged(this, new PropertyChangedEventArgs(name));
  22. }
  23. }
  24. }
  25. }