|
Rank: Advanced Member Groups: Member
Joined: 10/4/2016 Posts: 104
|
Hi, Not sure if I am missing something here, but no matter what I cannot display any content on top of an EO.WebBrowser.Wpf.WebControl element. For instance in the code below:
Code: XML
<Grid>
<Label Content="Hello World!" HorizontalAlignment="Center" Margin="0,20,0,0" FontSize="20" FontWeight="Bold"/>
<eo:WebControl x:Name="webContainer" Foreground="White">
<eo:WebControl.WebView>
<eo:WebView x:Name="webView">
</eo:WebView>
</eo:WebControl.WebView>
</eo:WebControl>
</Grid>
I was expecting to see my text content on top of the webContainer. It does in the Visual Studio design window but not at runtime. Also no matter what transparency I set on that same WebControl, it only responds to Visibility status. Opacity=0.0 has no effect. I also messed around with the z-order but it did not help either. Am I missing something here?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
This is normal and it's a known restriction of the WPF. The root of the problem is the so called "air space" issue related to child window. Basically as long as a child window exists (which is the case for EO.WebBrowser because the browser has its own window handle), the area of the child window owns that airspace and nothing in the parent window (which contains all other WPF control) can render over it. A number of workarounds have been discussed extensively over the web but they all have their limitations/problems. So you should avoid having such designs.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/4/2016 Posts: 104
|
Thank you for the prompt response. It sounds like therefore the WebControl is not really acting like a true WPF control but behaves like a Form and inherits its limitation. I wanted to adjust the transparency value of that control and show on top of it an animated gif whenever the page was refreshing/refreshing. I had been able to do so with another Chromium wrapper thought it exposed many other limitations. I guess I will have to find another way to accomplish this.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
The only way for you to overlap UI on top of the browser is to inject the overlapping UI into the browser ---- you can usually do this through JavaScript by setting WebView.JSInitCode. There are of course a number of limitation for this approach as well. One being since the overlapping UI is in fact "inside", not "on top of" the browser, you can not have half inside and half outside.
The WebBrowser control will never be a "true" WPF control. A "true" WPF control has no window and uses the WPF rendering pipeline to render. A browser engine will always handle the render itself due to both the complexity of the rendering process and performance reasons. MS's own WebBrowser control which is IE based has this limitation as well. Older browser engine does not talk to the GPU themselves, so it's possible for them to go through the WPF pipeline, but all modern browser engine does the rendering from the beginning to the end. It's not possible for them to join WPF"s rendering pipeline.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 10/4/2016 Posts: 104
|
Makes sense, I guess this is probably why I was able to do it with that other Chromium wrapper. Thanks again!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Christian Porzio wrote:Makes sense, I guess this is probably why I was able to do it with that other Chromium wrapper. Thanks again! You can check the version of the Chromium engine they used. We use a rather up to date engine (the current version is based on V49 and we are in the process of switching to V54). If they also use a rather new engine and can still do overlay, then we would be very curious to take a look.
|
|
Rank: Newbie Groups: Member
Joined: 7/3/2017 Posts: 8
|
I have just managed to solve the problem by embedding my overlay content in a WPF popup window. As it is a separate window, the GPU respects it. I even got partial transparency working.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Justin wrote:I have just managed to solve the problem by embedding my overlay content in a WPF popup window. As it is a separate window, the GPU respects it. I even got partial transparency working. That's a great idea. Yes. As long as you use a separate window it should work. Thanks for sharing!
|
|