protected virtual void OnEditorWindowCloseExecuted(object sender, ExecutedRoutedEventArgs e) { Window window = (Window)sender; PropertyGridProperty prop = window.DataContext as PropertyGridProperty; if (prop != null) { prop.Executed(sender, e); if (e.Handled) { return; } } window.Close(); }