-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Webrowser not showing up when using MahApps.Metro within' a C# WPF project. #488
Comments
@SomeoneAmazinglyAwesome you're right, that's a dilemma with microsoft webbrowser! |
AirspaceDecorator from https://microsoftdwayneneed.codeplex.com/ seems to work fine in MetroWindow with AllowTransparency set to true. But I'd prefer Awesomium over IE like punker76 mentioned. <controls:MetroWindow x:Class="MetroBrowserInterop.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:interop="clr-namespace:Microsoft.DwayneNeed.Interop;assembly=Microsoft.DwayneNeed"
Title="MainWindow"
AllowsTransparency="True">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<interop:AirspaceDecorator AirspaceMode="Redirect"
Background="White"
IsInputRedirectionEnabled="True"
IsOutputRedirectionEnabled="True">
<WebBrowser Source="http://www.google.com" />
</interop:AirspaceDecorator>
<Border HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="SkyBlue"
BorderBrush="DeepSkyBlue"
BorderThickness="1"
Opacity="0.5">
<TextBlock Margin="50"
FontSize="24"
Text="Hello Airspace" />
</Border>
</Grid>
</controls:MetroWindow> |
I can confirm that @bitterskittles idea works on one of my other projects. |
this DLL broken my designer after restart the VS |
well debugging the DLL i find the bug (crasher designer :P) if you need use this library fix this lines in the File in the Void private void UpdateOutputRedirection() REPLACE ALL FOR THIS
|
Alternatively you can set AirspaceDecorator.AirspaceMode="None" in XAML and change it to redirect in runtime to avoid offscreen redirection inside the designer. |
@punker76 Thankz for the quick reply on this issue, I tried Awesomium and it worked perfectly. 👍 |
Hi @SomeoneAmazinglyAwesome ! I guess I can mark this as closed. |
… DWM non-client rendering directly. Added http://archive.msdn.microsoft.com/WPFShell for MA.M .NET 4 client profile. Fixes #481, #488, #496.
… DWM non-client rendering directly. Added http://archive.msdn.microsoft.com/WPFShell for MA.M .NET 4 client profile. Fixes #481, #488, #496.
I think I've discovered some crazy glitch within MahApps.Metro, everything seemed fine until I decided to implement one of the Microsoft Controls in Visual Studio.
I added the MahApps.Metro theme via NuGet, and everything worked fine, but when I added the Webrowser Control (I used C# to tell it to navigate to Google) & debugged the program...
Nothing shows up, as if the webrowser was set to transparent.
It might have something to do with:
http://blogs.msdn.com/b/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.asp (Webrowser controls not working with allowTransperancy set to true).. Maybe MahApps.Metro overiddes the control & sets the property to true... Anybody having the same issue...?!?!
Any ideas on a possible work around or fix?
The text was updated successfully, but these errors were encountered: