TemplateVM.cs 627 B

12345678910111213141516171819202122232425
  1. using System.ComponentModel;
  2. using Windows.UI.Core;
  3. namespace YJMPD_UWP.ViewModels
  4. {
  5. public class TemplateVM : INotifyPropertyChanged
  6. {
  7. protected CoreDispatcher dispatcher;
  8. public TemplateVM(string title)
  9. {
  10. dispatcher = App.Dispatcher;
  11. if (App.MainPage != null)
  12. App.MainPage.Title = title;
  13. }
  14. public event PropertyChangedEventHandler PropertyChanged;
  15. protected void NotifyPropertyChanged(string propertyName)
  16. {
  17. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  18. }
  19. }
  20. }