private void starterDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { // search for the row on which the user performed the doubleclick DependencyObject dp = (DependencyObject)e.OriginalSource; while (dp != null && !(dp is DataGridRow)) { dp = VisualTreeHelper.GetParent(dp); } // if the row is not found, the user did not perform a doublclick on a row if (dp is DataGridRow) { Starter starter = ((DataGridRow)dp).DataContext as Starter; if (starter != null) { EditStarterWindow ed = new EditStarterWindow(starter); ed.ShowDialog(); } } }
public EditStarterWindow(Starter starter) { InitializeComponent(); _starter = starter; }
/// <summary> /// Deprecated Method for adding a new object to the Starter EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToStarter(Starter starter) { base.AddObject("Starter", starter); }