private void AddProductButton_Click(object sender, System.Windows.RoutedEventArgs e) { ProductEditor dialog = new ProductEditor(); dialog.Closed += new EventHandler(ProductEditorDialog_AddClosed); dialog.DataContext = null; // show the dialog dialog.SetForAdd(); dialog.ShowDialog(); }
private void UpdateProductButton_Click(object sender, System.Windows.RoutedEventArgs e) { ProductEditor dialog = new ProductEditor(); dialog.Closed += new EventHandler(ProductEditorDialog_UpdateClosed); // wire up the context of the dialog to be the same as this editor dialog.DataContext = this.DataContext; // show the dialog dialog.SetForUpdate(); dialog.ShowDialog(); }