Beispiel #1
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            CGear      newgear = new BicycleCalculatorWPF.CGear(gearlists.type, "", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
            GearEditor geditor = new GearEditor(this.Title, newgear, true, false);

            if (geditor.ShowDialog() != true)
            {
                return;
            }
            data.AddGear(newgear);
            ButtonSave.IsEnabled = true;
            LoadData();
        }
Beispiel #2
0
        private void ButtonModify_Click(object sender, RoutedEventArgs e)
        {
            if (listBox1.SelectedIndex == -1)
            {
                return;
            }
            GearEditor geditor = new GearEditor(this.Title, (CGear)listBox1.SelectedItem, false, false);

            if (geditor.ShowDialog() == true)
            {
                ButtonSave.IsEnabled = true;
            }
            listBox1.Items.Refresh();
        }