コード例 #1
0
ファイル: MainViewModel.cs プロジェクト: collinsc/TicTacToe
        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
ファイル: CellDisplayList.cs プロジェクト: collinsc/TicTacToe
 public CellDisplayList()
 {
     EventMediator.Subscribe(nameof(GameViewModel.GameEndedCommand), GameOverCB);
 }
コード例 #3
0
 public GameViewModel() : base()
 {
     EventMediator.Subscribe(nameof(ViewModelLocator.MainMenu.GoToGameCommand), StartGame);
 }