diff --git a/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs b/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs index 0333e332ec89..491366642de9 100644 --- a/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs +++ b/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs @@ -21,6 +21,7 @@ public partial class ShellHandler [nameof(IFlyoutView.FlyoutWidth)] = MapFlyoutWidth, [nameof(Shell.FlyoutBackground)] = MapFlyoutBackground, [nameof(Shell.FlyoutBackgroundColor)] = MapFlyoutBackground, + [nameof(Shell.FlyoutContent)] = MapFlyout, [nameof(Shell.CurrentItem)] = MapCurrentItem, [nameof(Shell.FlyoutBackdrop)] = MapFlyoutBackdrop, [nameof(Shell.FlyoutFooter)] = MapFlyoutFooter, diff --git a/src/Controls/tests/DeviceTests/Elements/Shell/ShellFlyoutTests.cs b/src/Controls/tests/DeviceTests/Elements/Shell/ShellFlyoutTests.cs index 5e9dd489a887..9a51b1efdbe8 100644 --- a/src/Controls/tests/DeviceTests/Elements/Shell/ShellFlyoutTests.cs +++ b/src/Controls/tests/DeviceTests/Elements/Shell/ShellFlyoutTests.cs @@ -17,6 +17,30 @@ namespace Microsoft.Maui.DeviceTests { public partial class ShellTests : ControlsHandlerTestBase { + [Fact] + public async Task FlyoutContentUpdatesAfterChange() + { + var flyoutContent = new VerticalStackLayout() + { + new Label() { Text = "Flyout Content" } + }; + + await RunShellTest(shell => + { + shell.FlyoutBehavior = FlyoutBehavior.Locked; + }, + async (shell, handler) => + { + Assert.False(flyoutContent.IsLoaded); + + shell.FlyoutContent = flyoutContent; + await OnLoadedAsync(flyoutContent); + + shell.FlyoutContent = null; + await OnUnloadedAsync(flyoutContent); + }); + } + #if !MACCATALYST [Fact] public async Task LogicalChildrenPropagateCorrectly() @@ -303,6 +327,8 @@ Thickness GetSafeArea() return Thickness.Zero; #endif } +#endif + async Task RunShellTest(Action action, Func testAction) { SetupBuilder(); @@ -319,6 +345,5 @@ async Task RunShellTest(Action action, Func te await testAction(shell, handler); }); } -#endif } } \ No newline at end of file