Window window = Utilities.GetVisualParent<Window>(this); if (window != null) { window.DialogResult = true; }