private void uxFileAdd_Click(object sender, RoutedEventArgs e) { var window = new ItemsWindow(); if (window.ShowDialog() == true) { var uiInventoryModel = window.Item; var repositoryInventoryModel = uiInventoryModel.ToRepositoryModel(); App.InventoryRepository.Add(repositoryInventoryModel); LoadItems(); } }
private void uxFileModify_Click(object sender, RoutedEventArgs e) { var window = new ItemsWindow(); if (selectedItem != null) { window.Item = selectedItem.Clone(); } if (window.ShowDialog() == true) { App.InventoryRepository.Update(window.Item.ToRepositoryModel()); LoadItems(); } }