private void uxFileUpdate_Click(object sender, RoutedEventArgs e) { var window = new ItemWindow(); window.Item = selectedItem; if (window.ShowDialog() == true) { App.InventoryRepository.Update(window.Item.ToRepositoryModel()); LoadInventory(); } }
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.InventoryRepository.Add(repositoryItemModel); LoadItems(); } }
private void uxFileChange_Click(object sender, RoutedEventArgs e) { var window = new ItemWindow(); if (selectedItem != null) { window.Item = selectedItem.Clone(); if (window.ShowDialog() == true) { App.InventoryRepository.Update(window.Item.ToRepositoryModel()); LoadItems(); } } }