private void EditBudget() { var vm = new EditBudgetViewModel(new UnitOfWorkFactory(), Budget); vm.Init(); var window = new EditBudgetView(vm); if (window.ShowDialog() ?? false) { OnPropertyChanged(nameof(Budget)); } }
private void NewBudget() { var budget = new Budget(); var vm = new EditBudgetViewModel(new UnitOfWorkFactory(), budget); vm.Init(); var window = new EditBudgetView(vm); if (window.ShowDialog() ?? false) { BudgetList.Add(budget); Budget = budget; } }