简体   繁体   English

在多个 WPF 控件中托管相同的 Win32 window

[英]Host same Win32 window within multiple WPF controls

I want to show the same Win32 window within different WPF user controls at the same time, is this possible?我想同时在不同的 WPF 用户控件中显示相同的 Win32 window,这可能吗?

I have an application with a main WPF Window with multiple child user controls.我有一个带有多个子用户控件的主 WPF Window 的应用程序。 I modify the visibility of these user controls so only one of them is visible at a given moment.我修改了这些用户控件的可见性,因此在给定时刻只有其中一个可见。 Two of these user controls contain a binding with the control that hosts a Win32 window (inherited from HwndHost), but when running the application I only see the Win32 window when visualizing the first of these user controls.其中两个用户控件包含与承载 Win32 window(从 HwndHost 继承)的控件的绑定,但是在运行应用程序时,在可视化这些用户控件中的第一个时,我只看到 Win32 window。 Am I missing something?我错过了什么吗?

A window in Win32 can't be displayed in two different places. Win32中的window不能在两个不同的地方显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM