private void editProductButton_Click(object sender, RoutedEventArgs e) { var editProductControl = new EditProductControl(AttachedProduct); editProductControl.OperationCompleted += EditProductControl_OperationCompleted; editProductControl.CanceledOperation += EditProductControl_CanceledOperation;; spEditView.Children.Add(editProductControl); spEditView.Visibility = Visibility.Visible; }
private void addProductButton_Click(object sender, RoutedEventArgs e) { var addProductControl = new EditProductControl(); addProductControl.OperationCompleted += AddProductControl_OperationCompleted; addProductControl.CanceledOperation += AddProductControl_CanceledOperation; dialogPopup.Child = addProductControl; dialogPopup.IsOpen = true; }