using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace connor_zwcadm.util { public class UIUtil { public static void SetOwnerWindow(Window window) { System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(window); helper.Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle; } public static void DispatcherShow(Window win, string msg) { win.Dispatcher.Invoke(new Action(delegate { System.Windows.MessageBox.Show(win, msg); })); } } }