private void ButtonEdit_Click(object sender, RoutedEventArgs e) { if (_vm == null) { return; } AddEngineForm form = new AddEngineForm(OsLocalization.Entity.BtnEdit, _vm.SelectedEngine, null); var result = form.ShowDialog(); _vm.OnChanged(); ChangeContext(); }
private void ButtonAdd_Click(object sender, RoutedEventArgs e) { if (_vm == null) { return; } var engine = new EngineViewModel(); AddEngineForm form = new AddEngineForm(OsLocalization.Entity.BtnAdd, engine, _vm.Engines.ToList()); var result = form.ShowDialog(); if (result.HasValue && result.Value == true) { _vm.AddEngine(engine); } ChangeContext(); }