Example #1
0
        private void NewGame_Cancel(object sender, EventArgs e)
        {
            Views.MenuView          menu   = new Views.MenuView();
            ViewModel.MenuViewModel menuVM = new ViewModel.MenuViewModel();
            menuVM.NewGameEvent  += new EventHandler(Menu_New);
            menuVM.LoadGameEvent += new EventHandler(Menu_Load);
            menuVM.QuitGameEvent += new EventHandler(Menu_Quit);
            menu.DataContext      = menuVM;

            ChangeView(menu);
        }
Example #2
0
        private void ToMenu()
        {
            Views.MenuView          menu   = new Views.MenuView();
            ViewModel.MenuViewModel menuVM = new ViewModel.MenuViewModel();
            menuVM.NewGameEvent  += new EventHandler(Menu_New);
            menuVM.LoadGameEvent += new EventHandler(Menu_Load);
            menuVM.QuitGameEvent += new EventHandler(Menu_Quit);
            menu.DataContext      = menuVM;

            ChangeView(menu);
        }
Example #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Views.MenuView          menu   = new Views.MenuView();
            ViewModel.MenuViewModel menuVM = new ViewModel.MenuViewModel();
            menuVM.NewGameEvent  += new EventHandler(Menu_New);
            menuVM.LoadGameEvent += new EventHandler(Menu_Load);
            menuVM.QuitGameEvent += new EventHandler(Menu_Quit);
            menu.DataContext      = menuVM;

            _mainViewModel = new ViewModel.MainViewModel(menu);
            _mainWindow    = new View.MainWindow();

            _mainWindow.DataContext = _mainViewModel;
            _mainWindow.Show();
        }