Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using System.Xml.Linq;
  16.  
  17. namespace wpfapp
  18. {
  19.     /// <summary>
  20.     /// Interaction logic for MainWindow.xaml
  21.     /// </summary>
  22.     public partial class MainWindow : Window
  23.     {
  24.         public MainWindow()
  25.         {
  26.             InitializeComponent();
  27.         }
  28.  
  29.         private void ButtonAddName_Click(object sender, RoutedEventArgs e)
  30.         {
  31.             if (!string.IsNullOrWhiteSpace(textName.Text) && !listNames.Items.Contains(textName.Text))
  32.             {
  33.                 listNames.Items.Add(textName.Text);
  34.                 textName.Clear();
  35.             }
  36.         }
  37.     }
  38. }
  39.