Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }