private void TourListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (TourListBox.SelectedItem is Tournaments tour) { TournamentWindow tournamentWindow = new TournamentWindow(PlayersViewModel, TeamViewModel, TournamentViewModel, tour); tournamentWindow.Show(); } }
public static void OpenTournamentWindow(ITournamentGameModel game) { /** * Sprawdz czy stol uruchomiony * jesli tak podswietl go jesli nie - utworz nowe okno stolu * */ if (Application.Current.Windows.OfType <TournamentWindow>().Any(t => t.GameModel.TournamentModel.ID == game.TournamentModel.ID)) { return; } TournamentWindow gameWindow = new TournamentWindow(game); gameWindow.Owner = MainWindow.Instance; gameWindow.Show(); gameWindow.Owner = null; }