1、需要添加一些引用

【WPF】Winform调用WPF窗体注意事项

2、调用处使用如下方法进行调用

Window win= new Window();   
ElementHost.EnableModelessKeyboardInterop(win);
WindowInteropHelper winHelper = new WindowInteropHelper(win);
winHelper.Owner = this.Handle;
win.Show();

 没有ElementHost.EnableModelessKeyboardInterop(wpfwindow)WPF快捷键无效。

WindowInteropHelper类作用是为WPF设置owner。

 

相关文章:

  • 2021-08-22
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-02
  • 2021-11-29
  • 2021-08-24
  • 2022-12-23
  • 2021-09-22
  • 2021-08-23
  • 2022-12-23
相关资源
相似解决方案