
I am using the WPF System.Windows.Controls.WebBrowser control to display some HTML content in a ToolWindow. My View is defined like the following.
<UserControl … >
<Grid>
<ContentControl Content=”{Binding WebBrowser}” />
</Grid>
</UserControl>
The ViewModel for this View is like the following.
public class MyViewModel : ToolItemViewModel {
private WebBrowser _webBrowser;
public MyViewModel() {
WebBrowser = new WebBrowser();
}
public WebBrowser WebBrowser {
get { return _webBrowser; }
set { _webBrowser = value };
}
}
This View gets wrapped in a ToolWindow for the DockSite using the ToolItemSource. There is one and only one WebBrowser control at one time.
<docking:DockSite ToolItemSource=”{Binding ToolItems}”
ToolItemContainerStyle=”{StaticResource ToolItemStyle}”>
</docking:DockSite>
When this ToolWindow is open and visible, and then I open the backstage on the ribbon, the browser control is drawing on top of the backstage. In the past I have tracked when the backstage becomes visible and I hide the browser control, this has worked well in the past. I also noticed that when this ToolWindow is hidden (unpinned) there is a lag for when the Browser becomes visible and/or becomes invisible within the ToolWindow.
I noticed that there is a web browser sample that talks about the Interop Compatibility. I have tried to use the InteropFocueTracking and the DockSite.UseHostedPopups but they do not seem to affect this issue.
If anyone has any suggestions how a better way to deal with this issue please let me know.