dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.16k stars 1.74k forks source link

Flyout Page SetCollapseStyle doesn't have any change #18200

Open AnithaRaniT opened 1 year ago

AnithaRaniT commented 1 year ago

Flyout Page SetCollapseStyle doesn't have any effect In.Net7 MAUI for windows platform

Create a sample maui app, Create a FlyoutPage and in the code behind add On<Windows>().SetCollapseStyle(CollapseStyle.Partial)

It works fine with the xamarin forms, but same Api is not working in maui.

I followed As per the Microsoft Doc https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.controls.platformconfiguration.windowsspecific.flyoutpage.setcollapsestyle?view=net-maui-7.0

Here is the sample project: MauiApp1.zip

AnithaRaniT commented 1 year ago

@samhouts or @jsuarezruiz can you help me with this issue

ghost commented 1 year ago

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

AnithaRaniT commented 1 year ago

Is there any work around for this?

Sweekriti91 commented 9 months ago

A workaround for this is to use a Mapper and set the WinUI NavigationPage property PaneDisplayMode from the documentation. I'm attaching the sample code here : MauiApp1_fixed.zip

The mapper code :

Microsoft.Maui.Handlers.FlyoutViewHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
        {
#if WINDOWS
            handler.PlatformView.GotFocus += (s, e) =>
            {
                handler.PlatformView.PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.LeftCompact;
            };
#endif