private void EndGame() { _game.CalculateTime(DateTime.Now); _game.SaveResults(); var popup = new GameOverPopup { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; ButtonsGrid.Children.Add(popup); Grid.SetColumn(popup, 0); Grid.SetRow(popup, 1); Grid.SetColumnSpan(popup, ButtonsGrid.ColumnDefinitions.Count); var endGamePopupTimer = new Timer {Interval = 3000}; endGamePopupTimer.Elapsed += ShowEndGamePopup; endGamePopupTimer.Start(); }
private void EndGame() { _game.CalculateTime(DateTime.Now); _game.SaveResults(); var popup = new GameOverPopup { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, }; MainGrid.Children.Add(popup); Grid.SetColumnSpan(popup, MainGrid.ColumnDefinitions.Count); Grid.SetRowSpan(popup, MainGrid.RowDefinitions.Count); _endGamePopupTimer = new Timer {Interval = 3000}; _endGamePopupTimer.Elapsed += endGamePopupTimer_Elapsed; _endGamePopupTimer.Start(); }