Rank: Newbie Groups: Member
Joined: 11/15/2018 Posts: 3
|
I am trying to use EO web viewer inside my wpf user control, I have a Simple user control which has a web viewer in it, at run time the web viewer is spilling over the container(scroll viewer). I have attached a sample application for your reference.
Expected behavior like other controls web browser also should get scrolled without spilling over the space given for it.
Usercontrol:
UserControl x:Class="EOWebBrowserTEst.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:eo="http://schemas.essentialobjects.com/wpf/"> <Grid> <eo:WebControl Height="600" Width="500"> <eo:WebControl.WebView> <eo:WebView x:Name="Eowebview" Url="www.google.com"> </eo:WebView> </eo:WebControl.WebView> </eo:WebControl> </Grid> </UserControl>
MainWindow:
<Grid Height="500" Background="LightGray" > <ScrollViewer> <thi:UserControl1></thi:UserControl1> </ScrollViewer> </Grid>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, This is a known issue and there is no good solution rather than not using ScrollViewer. The root of the problem is ScrollViewer and child window (through HWndHost) does not work properly together. This is because ScrollViewer works with clip region, where clip region only applies to the same window, but not child windows. This is part of a larger issue that is called "airspace issue" of WPF. You can find more information about this issue here: https://blogs.msdn.microsoft.com/dwayneneed/2013/02/26/mitigating-airspace-issues-in-wpf-applications/Thanks
|