0

I have a HwndSource and I have two WPF user controls, I would like to set one of them the RootVisual of this HwndSource and sometimes switch between these two WPF user controls.

Just wonder am I able to do that?

My two WPF user controls are: m_media, m_stored,

First time I just new the HwndSource object and use HwndSource.RootVisual = m_media to set the root visual, then I want to change its root visual to m_stored, can anybody tell me how to do that?

Thank you very much everybody.

  • Maybe you can explain what you're *actually* trying to achieve. Why do you need to switch them inside a single `HwndSource`? – dymanoid Nov 08 '17 at 15:39
  • Hi, I would like to switch the video view between two different video source, I can also create a new HwndSource hold the other user control, but still have to know how to bring one of those to the front each time I want to see that. – Xiangtianyu Kong Nov 08 '17 at 15:58
  • You can use a `TabControl` with hidden tab headers as a `RootVisual` and just switch tabs. This `TabControl` would contain two tabs, so that each tab holds the corresponding user control. – dymanoid Nov 08 '17 at 17:03

0 Answers0