private void Ingredients_Click(object sender, EventArgs e) { if (MasterContext == null) { MasterContext = GetMasterContext(); } ManagerWindow mw = ManagerWindow.GetIngredientManager(MasterContext); mw.MyParent = this; mw.Show(); Hide(); }
public static ManagerWindow GetIngredientManager(IMealPlannerContext db) { ManagerWindow mw = new ManagerWindow() { Text = "Ingredient Manager", db = db, ListBoxDataSource = db.GetIngredients() }; mw.AddClickMethod = mw.AddIngredientDelegate; return(mw); }