HomeViewModel.cs 738 B

1234567891011121314151617181920212223242526272829
  1. using HelloItQuantum.Views;
  2. namespace HelloItQuantum.ViewModels
  3. {
  4. public class HomeViewModel : MainWindowViewModel
  5. {
  6. public void ClickPlay()
  7. {
  8. PlaySectionVM = new PlaySectionViewModel();
  9. PageSwitch.View = new PlaySectionView();
  10. }
  11. public void ClickStatistic()
  12. {
  13. ProgressVM = new ProgressViewModel();
  14. PageSwitch.View = new ProgressView();
  15. }
  16. public void ClickExit()
  17. {
  18. AuthVM = new AuthViewModel();
  19. PageSwitch.View = new AuthView();
  20. /* //Ýòî êîä äëÿ çàêðûòèÿ ïðîãðàììû
  21. * Window window = (App.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime)?.MainWindow;
  22. if (window != null)
  23. window.Close();*/
  24. }
  25. }
  26. }