private void Button_Click(object sender, RoutedEventArgs e) { // HelloWorldViewModel.CreatePlayer(); PlayerView anotherWindows = new PlayerView(); anotherWindows.Top = 100; anotherWindows.Left = 400; this.Visibility = Visibility.Collapsed; anotherWindows.ShowDialog(); this.Visibility = Visibility.Visible; ListViewJoueurTitle.ClearValue(ItemsControl.ItemsSourceProperty); ListViewJoueurTitle.ItemsSource = Player.AllPlayer.Values.ToList(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (ListViewJoueurTitle.SelectedItems.Count == 0) { return; } var selectedPlayer = ListViewJoueurTitle.SelectedItems[0] as Player; int key = selectedPlayer.IdJoueur; Player.AllPlayer.Remove(key); ListViewJoueurTitle.ClearValue(ItemsControl.ItemsSourceProperty); ListViewJoueurTitle.ItemsSource = Player.AllPlayer.Values.ToList(); }
private void Button_Click_2(object sender, RoutedEventArgs e) { var selectedPlayer = ListViewJoueurTitle.SelectedItems[0] as Player; int key = selectedPlayer.IdJoueur; PlayerView anotherWindows = new PlayerView(); anotherWindows.Top = 100; anotherWindows.Left = 400; this.Visibility = Visibility.Collapsed; anotherWindows.boxPseudo.Text = Player.AllPlayer[key].Pseudo; anotherWindows.boxFirstName.Text = Player.AllPlayer[key].UserFirstName; anotherWindows.boxLastName.Text = Player.AllPlayer[key].UserLastName; Player.AllPlayer.Remove(key); anotherWindows.ShowDialog(); this.Visibility = Visibility.Visible; ListViewJoueurTitle.ClearValue(ItemsControl.ItemsSourceProperty); ListViewJoueurTitle.ItemsSource = Player.AllPlayer.Values.ToList(); }