Reputation: 2245
I have an excel AddIn which exposes IWin32Window as it's main UI. I want to show a WPF window that uses this as it's parent.
How do I go about doing that ?
Upvotes: 10
Views: 3213
Reputation: 139256
I think you need to use a WindowInteropHelper, like shown here: IWin32Window Owner For WPF Window
Upvotes: 0
Reputation: 564851
You can use WindowInteropHelper to parent the WPF window appropriately:
var helper = new WindowInteropHelper(theWpfWindow);
helper.Owner = win32Window.Handle;
theWpfWindow.Show(); // This is now parented appropriately
Upvotes: 8