private void uxFileChange_Click(object sender, RoutedEventArgs e) { var window = new ItemWindow(); window.Item = selectedItem; if (window.ShowDialog() == true) { App.ItemRepository.Update(window.Item.ToRepositoryModel()); selectedItem = null; LoadItems(); } }
private void uxFileNew_Click(object sender, RoutedEventArgs e) { var window = new ItemWindow(); if (window.ShowDialog() == true) { var uiItemModel = window.Item; var repositoryItemModel = uiItemModel.ToRepositoryModel(); App.ItemRepository.Add(repositoryItemModel); // OR //App.ItemRepository.Add(window.Item.ToRepositoryModel()); LoadItems(); } }