/// <summary> /// Launches the UI to edit an item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditItemButtonClick(object sender, RoutedEventArgs e) { Control control = sender as Control; // The item to edit is bound to the "Tag" property ModifyItemChildWindow window = new ModifyItemChildWindow( ((Item)control.Tag)); window.NewItem = false; window.Closed += new EventHandler(ModifyItemWindowClosed); window.Show(); }
/// <summary> /// Handles launching a UI for creating a new window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NewItemButtonClick(object sender, RoutedEventArgs e) { Control control = sender as Control; // The parent list is bound to the "Tag" property ModifyItemChildWindow window = new ModifyItemChildWindow( ((ModelList)control.Tag)); window.NewItem = true; window.Closed += new EventHandler(ModifyItemWindowClosed); window.Show(); }