Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebBrowser control not visible #727

Closed
ssolomon opened this issue Oct 23, 2013 · 10 comments
Closed

WebBrowser control not visible #727

ssolomon opened this issue Oct 23, 2013 · 10 comments

Comments

@ssolomon
Copy link

In the version available via Nuget, WebBrowser controls on a page are visible. However, on the current latest, WebBrowsers controls are not displaying their content. The content is there, and you are able to view source, but the contents are not visible. This could be related to a known issue with WebBrowser controls when used in a windows with AllowsTransparancy turned on.

@punker76
Copy link
Member

The WebBrowser wrap around native controls. Since they use a different graphics engine than WPF, you may be running into the Airspace issue as shown here: #488

@ssolomon
Copy link
Author

Thanks your response. As the mentioned previously and as the other issue also refers, I am sure the issue is related to Window Transparency. I know the Linked issue talks about a work around, but this is far from ideal. This issue has been introduced with the last source code, but was not an issue in the current release, so suggesting using a workaround does not really feel like a solution.

@punker76
Copy link
Member

@ssolomon another solution is to remove the transparency by hand. put this lines in your MetroWindow xaml and all should work (same as in MetroDemo.InteropDemo):

  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

<i:Interaction.Behaviors>
    <behaviours:BorderlessWindowBehavior ResizeWithGrip="True" AllowsTransparency="False" />
</i:Interaction.Behaviors>

@punker76
Copy link
Member

@ssolomon is this issue still present?

@michaelmairegger
Copy link
Contributor

I had the same issue with a ReportViewer in connectin with WindowsFormHost. Your solution with the behaviours works. Thanks a lot.

@ssolomon
Copy link
Author

I have not tried the solution with the behaviour yet. But still does not feel right that I need to use a behaviour to fix this.

@punker76
Copy link
Member

@ssolomon he, i give you two solutions to fix a windows wpf problem. what next?

@AzureKitsune
Copy link
Member

@ssolomon We can't "fix" the issue of the differences in the graphics engine between WPF and Windows Forms. Turning off Transparency or using the Airspace decorator are both solutions to this issue. It is a known WPF issue, not a MahApps.Metro one.

If you really don't want to use a behavior, set AllowsTransparency (directly on your window) to false.

@ssolomon
Copy link
Author

Hi. Thanks for you comment. I am aware that it is an issue in WPF and not something you can 'fix'. The point I was making was that in older versions of the library, everything was fine, so you obviously introduced something later that made the issue occur. The other point I was making was that setting AllowsTransparancy directly on the window did NOT work. However, using the behaviour does, and I am happy to go with approach. Cheers.

@djmiller9975
Copy link

I'm trying your solution above and VS tells me that AllowsTransparency is not recognized or inaccessible. It doesn't let me pick anything after BorderlessWindowBehavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants