private void Button_Click(object sender, RoutedEventArgs e) { string[] pickedCards = CardPicker.PickSomeCards((int)numberOfCards.Value); listOfCards.Items.Clear(); foreach (string card in pickedCards) { listOfCards.Items.Add(card); } }
private void Button_Click(object sender, RoutedEventArgs e) { ListedCardsBox.Items.Clear(); if (int.TryParse(NumberStorage, out int result)) { foreach (string card in CardPicker.PickRandonCards(result)) { ListedCardsBox.Items.Add(card); } } }
private void button_Click(object sender, RoutedEventArgs e) { string[] pickedCards = CardPicker.PickSomeCards((int)numberOfCards.Value); // Clears the list and removes all references listOfCards.Items.Clear(); //Update the list now foreach (string card in pickedCards) { listOfCards.Items.Add(card); } }