static void EditCommand_Execute(object param) { if (param is Category category) { var dialog = new EditCategory() { DataContext = category }; dialog.ShowDialog(); } }
private void editCategoryToolStripMenuItem_Click(object sender, EventArgs e) { EditCategory editCategoryForm = new EditCategory(this.currentUser, this); editCategoryForm.ShowDialog(); }