-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Windows] Setting ModalPage background to transparent no longer displays the underlying view #7450
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Can confirm this bug. Workaround is to set the background of the parent object of the page to transparent. var parentView = (Page)this.Parent; |
as suggested by @addie010 in dotnet/maui#7450
@eddie010 I am really interested in your workaround, but can't get it working. Here are the things i tried, but depending on where i put your workaround, i get different exceptions: Which page is
And when/where do you apply the code?
|
@dabbinavo Did you get a response from @eddie010 about how to apply the workaround? |
@JohnHunterACS Unfortunately not. Still waiting for someone who knows how to apply the workaround.. |
@PureWeen Is there any workaround that can be applied without touching the MAUI library? I tried setting the // This is a member function of the transparent modal ContentPage and is called on the modal ContentPage instance after it is pushed via Navigation.PushModalAsync
public void ApplyWorkaroundPureWeen()
{
var windowManager = this.Handler.MauiContext.Services.GetRequiredService<NavigationRootManager>();
var windowRootView = windowManager.RootView as WindowRootView;
windowRootView.Background = SolidColorBrush.Transparent.Color.ToPlatform(); // Still a white background. Even if using e.g. 'Blue' instead of 'Transparent'
} You can see the full demo application including this workaround approach here: Unfortunately, the underlying view does not shine through and the part below the transparent area of the modal ContentPage is still white. It is even white, when setting the background of the WindowRootView to something like blue. I also tried the workaround provided by @eddie010, but unfortunately don't get it running. |
I think this has been fixed with the latest .NET 8 RC, at least for me. |
This behavior broke
xamarin/Xamarin.Forms#8551
The reason here is that the modal page is now nested inside a NavigationView so we need to set some backgrounds on the WindowRootView to transparent so the underlying view can shine through
Work started here
https://github.com/dotnet/maui/tree/fix_winui_modal_transparent
The text was updated successfully, but these errors were encountered: