I know that default WPF behavior is to render WPF controls and then on top render WinForms, but are there any way to render WPF on top of WindowsFormsHost
?
Edit: I have found a temp hack as well. When wpf control overlaps WindowsFormsHost
, I change the size of the WindowsFormsHost
(This only works when you have rectangular object which overlaps, doesn't work for other shapes.)
If anyone finds themselves unsatisfied with the hacks, setting the Visibility of the WindowsFormsHost to Collapsed or Hidden is always an option.
Try this on for size:
Late to the party, I know, but I recently came across this issue using a WebBrowser control.
The final fix was to create a screenshot of the web browser whenever I hosted a modal dialog over the top. Since this was a little fiddly, I turned it into a Github project, hopefully this helps a little -
https://github.com/chris84948/AirspaceFixer
(It's on Nuget too, under AirspaceFixer)
Once you have the project all you need to do is this
Where
FixAirspace
is the dependency property that switches from the "real" view of the content, to the screenshot or "fake" view.This "airspace" issue is suppose to be fixed in WPF vNext. There are a couple solutions out there, such as here, here, and here.
One way to do this is to host the WPF content in a transparent Popup or Window, which overlays the Interop content.
Here's a link to the best answer I've seen on this subject so far: Can I overlay a WPF window on top of another?