我有一个 excel 插件,它公开 IWin32Window 作为它的主 UI。
我想显示一个使用它作为父级的 WPF 窗口。
我该怎么做?
最佳答案
您可以使用 WindowInteropHelper适本地为 WPF 窗口设置父级:
var helper = new WindowInteropHelper(theWpfWindow);
helper.Owner = win32Window.Handle;
theWpfWindow.Show(); // This is now parented appropriately
关于wpf - WPF 中的 IWin32Window,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5543509/