示例#1
0
        /// <summary>
        /// Method that instantiates the initial view model and data set.
        /// </summary>
        private void InstantiateAndShowView()
        {
            // Instantiate the view model and initialize the initial data set
            _gameSessionViewModel = new GameViewModel(_player, _messages, _gameMap, _currentLocation);
            GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel)
            {
                DataContext = _gameSessionViewModel
            };

            // Display main gameplay window.
            gameSessionView.Show();

            // Closes the set-up window if open.
            _playerSetupView.Close();
        }
示例#2
0
        /// <summary>
        /// Methodd that instantiates the initial view model and data set.
        /// </summary>
        private void InstantiateAndShowView()
        {
            // instantiate the view model and initialize the data set
            _gameSessionViewModel = new GameSessionViewModel(
                _player,
                GameData.InitialMessages()
                );
            GameSessionView gameSessionView = new GameSessionView(_gameSessionViewModel)
            {
                DataContext = _gameSessionViewModel
            };

            gameSessionView.Show();


            _playerSetupView.Close();
        }