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.26k stars 1.76k forks source link

[Windows] Fix FlyoutPage ShouldShowToolbarButton when overridden to return false, still shows button in title bar #25857

Open devanathan-vaithiyanathan opened 1 week ago

devanathan-vaithiyanathan commented 1 week ago

Issue details

When Popover behavior is applied to a FlyoutPage with ShouldShowToolbarButton set to false, the hamburger icon still appears in the Windows title bar.

Root Cause

In Windows, When the ShouldToolBarButton is override as false, hardly setting WinUI IsPaneToggleButtonVisible as True based on FlyoutBehavior to control navigation visibility with no handling to restrict the visibility of the ToolBarButton.

Description of Change

Since we are controlling the DrawerToggleVisible value based on the visibility of the ToolBarButton, which in turn manages the visibility of the TogglePaneButton in WinUI. This ensures that the toolbar now correctly reflects the DrawerToggleVisible state, improving the consistency of navigation element.

Issues Fixed

Fixes #24547

Tested the behaviour in the following platforms

Output Screenshot

Before After
dotnet-policy-service[bot] commented 1 week ago

Hey there @devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

jsuarezruiz commented 1 week ago

/azp run

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 3 pipeline(s).
jsuarezruiz commented 6 days ago

/azp run

azure-pipelines[bot] commented 6 days ago
Azure Pipelines successfully started running 3 pipeline(s).
jsuarezruiz commented 1 day ago

/azp run

azure-pipelines[bot] commented 1 day ago
Azure Pipelines successfully started running 3 pipeline(s).
jsuarezruiz commented 22 hours ago

/azp run

azure-pipelines[bot] commented 22 hours ago
Azure Pipelines successfully started running 3 pipeline(s).