void dgWebPages_RowDoubleClick(object sender, MouseButtonEventArgs e) { dgWebPages.CancelEdit(); // https://stackoverflow.com/questions/16236905/access-parent-window-from-user-control var dlg = new PatternsWebPagesDetailDlg(Window.GetWindow(this), vmWP, (MPatternWebPage)((DataGridRow)sender).Item); dlg.ShowDialog(); }
void btnAddWebPage_Click(object sender, RoutedEventArgs e) { var dlg = new PatternsWebPagesDetailDlg(Window.GetWindow(this), vmWP, vmWP.NewPatternWebPage()); dlg.ShowDialog(); }