private void OurGamesListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (OurGamesListBox.SelectedItem is Game game) { DescriptionOfGameWindow discriptionOfGameWindow = new DescriptionOfGameWindow(_storage, game); discriptionOfGameWindow.Show(); Close(); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_restartingTheGame) { if (_testingMode) { QuestionsWindow questionsWindow = new QuestionsWindow(_testingMode, _storage, _game, _wereThereAlreadySomeChangings); questionsWindow.Show(); } else { IGame game = _game; game.UpdatePicture(_game.Picture); UpdatePopularity(); DescriptionOfGameWindow discriptionOfGameWindow = new DescriptionOfGameWindow(_storage, game); discriptionOfGameWindow.Show(); } } else { if (!_testingMode) { UpdatePopularity(); PlayingModeWindow playingModeWindow = new PlayingModeWindow(_storage); playingModeWindow.Show(); } else { Developer_III_Window developerWindow = new Developer_III_Window( _storage.Users.Items.First(u => u.Id == _game.UserId), _game, _storage, _wereThereAlreadySomeChangings); developerWindow.Show(); } } }