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

            this.InitializeComponent();
        }
Example #3
0
        public EndGameViewModel WhoWon()
        {
            var victory = new EndGameViewModel();

            if (CheckForWinner())
            {
                victory.Winner = Winner;
            }
            return(victory);
        }
Example #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));
            }
        }
Example #5
0
        public async Task EndGame(EndGameViewModel GameLogicEndGameView)
        {
            await _gameRepository.UpdateResult(GameLogicEndGameView.GameId, GameLogicEndGameView.Result);

            await _gamePlayerRepository.DeleteAllByGameId(GameLogicEndGameView.GameId);
        }
 public Scenario3()
 {
     this.InitializeComponent();
     ViewModel = new EndGameViewModel();
 }
Example #7
0
 public EndGameView()
 {
     DataContext = new EndGameViewModel();
     InitializeComponent();
 }
 public Scenario4()
 {
     this.InitializeComponent();
     ViewModel    = new EndGameViewModel();
     SizeChanged += Scenario4_SizeChanged;
 }