private void Edit_Click(object sender, RoutedEventArgs e) { // Get Id string IdString = ((TextBlock) ((Grid) ((StackPanel) ((Border) ((Button)sender).Parent).Parent).Parent).Children[0]).Text; int id = int.Parse(IdString); // Get episode ShowBindingModel model = controller.GetShow(id); // Edit info ChangeShow editWindow = new ChangeShow(model); editWindow.ShowDialog(); if (editWindow.DialogResult == true) { if (!controller.EditShow(id, model)) { MessageBox.Show("There was a problem. The show was not edited"); } } }
/// <summary> /// Raises event 'ChangeShow' /// </summary> protected virtual void OnChangeShow() { if (ChangeShow != null) { ChangeShow.Invoke(this, System.EventArgs.Empty); } }