public InlineDetailView() { InitializeComponent(); actionDictionary = new OrderedDictionary(); this.Loaded += (s, e) => { if (grid == null) { DependencyObject d = this; while (d != null) { d = VisualTreeHelper.GetParent(d); if (d is Controls.DataGrid) { grid = d as Controls.DataGrid; break; } } if (grid != null) { grid.GotKeyboardFocus += GotKeyboardFocusEventHandler; } } }; }
private void SelectionChangedEventHandler(object sender, DataGridSelectionChangedEventArgs e) { grid = e.OriginalSource as Controls.DataGrid; }