private void AddProductButton_Click(object sender, RoutedEventArgs e) { var productId = GetProductIds(Model.Products).GetNextId(); AddEditProduct addProductWindow = new AddEditProduct(productId, Model); addProductWindow.Owner = Window.GetWindow(this); Opacity = 0.75; addProductWindow.ShowDialog(); }
private void ModifyProductButton_Click(object sender, RoutedEventArgs e) { if (SelectedProduct != null) { AddEditProduct modifyProductWindow = new AddEditProduct(SelectedProduct.ProductId, Model); modifyProductWindow.Owner = Window.GetWindow(this); Opacity = 0.75; modifyProductWindow.ShowDialog(); } else { MessageBox.Show( "You must select a product to modify.", "No Product Selected", MessageBoxButton.OK, MessageBoxImage.Information ); } }