Exemplo n.º 1
0
        /// <summary>
        /// Function to add a trait to the minions list of traits.
        /// </summary>
        private void AddTrait_Click(object sender, RoutedEventArgs e)
        {
            bool inputOk = ReadTrait();

            if (inputOk)
            {
                minion.AddItem(txt_Trait.Text.Trim());
                lstTraits.ItemsSource = minion.Mylist;
                txt_Trait.Text        = string.Empty;
                _btnDelete.IsEnabled  = true;
            }
            else
            {
                MessageBox.Show("Must enter text", "Error", MessageBoxButton.OK);
            }
        }