private void EditCustomer() { var vm = new EditCustomerViewModel(new UnitOfWorkFactory(), SelectedCustomer); vm.Init(); var window = new EditCustomerView(vm); if (window.ShowDialog() ?? false) { CollectionViewSource.GetDefaultView(CustomerList).Refresh(); } }
private void NewCustomer() { var customer = new Customer(); var vm = new EditCustomerViewModel(new UnitOfWorkFactory(), customer); vm.Init(); var window = new EditCustomerView(vm); if (window.ShowDialog() ?? false) { CustomerList.Add(customer); } }