Exemple #1
0
 private void NewAccessory(object sender, RoutedEventArgs e)
 {
     Views.Forms.AccessoryForm form = new Forms.AccessoryForm();
     form.ShowDialog();
     if (form.ClosedWith == Views.Forms.CloseAction.Save)
     {
         this.ViewModel.Save(form.Accessory);
     }
 }
Exemple #2
0
        private void EditAccessory(object sender, RoutedEventArgs e)
        {
            if (this.ViewModel.SelectedAccessory != null)
            {
                Views.Forms.AccessoryForm form = new Forms.AccessoryForm(this.ViewModel.SelectedAccessory);
                form.ShowDialog();
                switch (form.ClosedWith)
                {
                case Forms.CloseAction.Save:
                    this.ViewModel.Save(form.Accessory);
                    break;

                case Forms.CloseAction.Delete:
                    this.DeleteAccessory(form, e);
                    break;
                }
            }
        }