Extension Method

internal static class InteropExtensions
{
    public static bool? ShowDialog(this System.Windows.Window win, IntPtr handle)
    {
        WindowInteropHelper helper = new WindowInteropHelper(win);
        helper.Owner = handle;
        return win.ShowDialog();
    }
}

 

Usage

var win = new WpfWindow();
win.ShowDalog(windowsFormOwnerHandle);

About Brian Keating
Brian Keating
Professional Software Developer, .NET / C++ / Java View all posts by Brian Keating →