示例#1
0
        public MainViewModel()
        {
            // Add available pages and set page
            PageViewModels.Add(ViewModelLocator.MainMenu);
            PageViewModels.Add(ViewModelLocator.Game);
            PageViewModels.Add(ViewModelLocator.Settings);

            //todo

            CurrentPageViewModel = PageViewModels[0];

            EventMediator.Subscribe(nameof(ViewModelLocator.MainMenu.GoToGameCommand), OnGoGameScreen);
            EventMediator.Subscribe(nameof(ViewModelLocator.Game.GoToMenuCommand), OnGoMenuScreen);
            EventMediator.Subscribe(nameof(ViewModelLocator.MainMenu.GoToExitCommand), OnGoExit);
            EventMediator.Subscribe(nameof(ViewModelLocator.MainMenu.GoToSettingsCommand), OnGoSettingsScreen);
            EventMediator.Subscribe(nameof(ViewModelLocator.Settings.GoToMenuCommand), OnGoMenuScreen);
        }
示例#2
0
 public CellDisplayList()
 {
     EventMediator.Subscribe(nameof(GameViewModel.GameEndedCommand), GameOverCB);
 }
示例#3
0
 public GameViewModel() : base()
 {
     EventMediator.Subscribe(nameof(ViewModelLocator.MainMenu.GoToGameCommand), StartGame);
 }