//only set DialogResult when window is ShowDialog before if(System.Windows.Interop.ComponentDispatcher.IsThreadModal) m_OwningWindow.DialogResult = true;