MainViewModel.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections.Generic;
  2. using System.ComponentModel;
  3. namespace SWRIS.Models.ViewModel
  4. {
  5. public class MainViewModel : INotifyPropertyChanged
  6. {
  7. private string appName;
  8. private string version;
  9. private string copyright;
  10. private string currentPage = "Home";
  11. private DebugMessageModel debugMessage = new DebugMessageModel(string.Empty);
  12. public string AppName
  13. {
  14. get => appName;
  15. set { appName = value; OnPropertyChanged("AppName"); }
  16. }
  17. public string Version
  18. {
  19. get => version;
  20. set { version = value; OnPropertyChanged("Version"); }
  21. }
  22. public string Copyright
  23. {
  24. get => copyright;
  25. set { copyright = value; OnPropertyChanged("Copyright"); }
  26. }
  27. public string CurrentPage
  28. {
  29. get => currentPage;
  30. set { currentPage = value; OnPropertyChanged("CurrentPage"); }
  31. }
  32. public DebugMessageModel DebugMessage
  33. {
  34. get => debugMessage;
  35. set { debugMessage = value; OnPropertyChanged("DebugMessage"); }
  36. }
  37. public DateTimeModel SystemTime { set; get; } = new DateTimeModel();
  38. public List<SwitchInstance> SwitchInstances { get; set; } = new List<SwitchInstance>();
  39. public event PropertyChangedEventHandler PropertyChanged;
  40. protected internal virtual void OnPropertyChanged(string propertyName)
  41. {
  42. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  43. }
  44. }
  45. }