예제 #1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            var addwnd = new AddWindow();

            ListBoxUnits.BeginInit();
            addwnd.ShowDialog();
            ListBoxUnits.EndInit();
        }
예제 #2
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            if (ListBoxUnits.SelectedItem == null)
            {
                return;
            }
            var unit = (KeyValuePair <string, Unit>)ListBoxUnits.SelectedItem;

            ListBoxUnits.BeginInit();
            Init.Units.Remove(unit.Key);
            ListBoxUnits.EndInit();
        }