protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     ViewModel = e.Parameter as EndGameViewModel;
     //DataContext = ViewModel;
     AppShell.Instance.ContentFrame.BackStack.Clear();
     SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
 }
Exemplo n.º 2
0
        public EndGameView()
        {
            this.viewModel   = new EndGameViewModel();
            this.DataContext = viewModel;

            this.InitializeComponent();
        }
Exemplo n.º 3
0
        public EndGameViewModel WhoWon()
        {
            var victory = new EndGameViewModel();

            if (CheckForWinner())
            {
                victory.Winner = Winner;
            }
            return(victory);
        }
Exemplo n.º 4
0
        public async Task <IHttpActionResult> EndGame(EndGameViewModel endGameViewModel)
        {
            try
            {
                if (endGameViewModel == null || endGameViewModel.Result == null)
                {
                    return(BadRequest(GameMessageHelper.ReceivedDataError));
                }

                await _gameService.EndGame(endGameViewModel);

                return(Ok(GameMessageHelper.Success));
            }
            catch (Exception ex)
            {
                string message = $"{ex.Source}|{ex.TargetSite}|{ex.StackTrace}|{ex.Message}";
                _logger.Error(message);
                return(BadRequest(GameMessageHelper.GameError));
            }
        }
Exemplo n.º 5
0
        public async Task EndGame(EndGameViewModel GameLogicEndGameView)
        {
            await _gameRepository.UpdateResult(GameLogicEndGameView.GameId, GameLogicEndGameView.Result);

            await _gamePlayerRepository.DeleteAllByGameId(GameLogicEndGameView.GameId);
        }
Exemplo n.º 6
0
 public Scenario3()
 {
     this.InitializeComponent();
     ViewModel = new EndGameViewModel();
 }
Exemplo n.º 7
0
 public EndGameView()
 {
     DataContext = new EndGameViewModel();
     InitializeComponent();
 }
Exemplo n.º 8
0
 public Scenario4()
 {
     this.InitializeComponent();
     ViewModel    = new EndGameViewModel();
     SizeChanged += Scenario4_SizeChanged;
 }