Extension Method for Wpf Window with Froms Owner

 

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);

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

Brian Keating is a developer addicted to Microsoft Technologies.

Month List

Tag cloud

RecentComments

Comment RSS