private void ProductEdit_Click(object sender, RoutedEventArgs e) { var editorF = new EditorFormProduct(((KeyValuePair<Int32, Product>)((MenuItem)sender).DataContext).Value); editorF.Owner = this; editorF.ShowDialog(); this.Show(); }
private void miAddProduct_Click(object sender, RoutedEventArgs e) { var editorF = new EditorFormProduct(); editorF.Owner = this; editorF.ShowDialog(); this.Show(); }