Skip to content
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

MenuFlyout's closing behavior should be configurable #10225

Closed
HotCakeX opened this issue Dec 10, 2024 · 3 comments
Closed

MenuFlyout's closing behavior should be configurable #10225

HotCakeX opened this issue Dec 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@HotCakeX
Copy link

Describe the bug

The <MenuFlyout> 's closing behavior needs to be configurable, so that it doesn't immediately close when the user wants to perform more than one action in the flyout menu.

Steps to reproduce the bug

This is the exact implementation that causes the problematic behavior displayed above to happen

<Button>
    <Button.Content>
        <StackPanel Orientation="Horizontal">
            <FontIcon Glyph="&#xE71C;" />
            <TextBlock Text="Filter" Margin="5,0,0,0" />
        </StackPanel>
    </Button.Content>

    <Button.Flyout>
        <MenuFlyout>

            <ToggleMenuFlyoutItem Text="A" x:Name="A" IsChecked="True">
                <ToggleMenuFlyoutItem.Icon>
                    <FontIcon Glyph="&#xEB41;" />
                </ToggleMenuFlyoutItem.Icon>
            </ToggleMenuFlyoutItem>

            <ToggleMenuFlyoutItem Text="B" x:Name="B" IsChecked="True">
                <ToggleMenuFlyoutItem.Icon>
                    <FontIcon Glyph="&#xECC4;" />
                </ToggleMenuFlyoutItem.Icon>
            </ToggleMenuFlyoutItem>

            <ToggleMenuFlyoutItem Text="C" x:Name="C" IsChecked="False">
                <ToggleMenuFlyoutItem.Icon>
                    <FontIcon Glyph="&#xE770;" />
                </ToggleMenuFlyoutItem.Icon>
            </ToggleMenuFlyoutItem>

            <ToggleMenuFlyoutItem Text="D" x:Name="D"
                IsChecked="False">
                <ToggleMenuFlyoutItem.Icon>
                    <FontIcon Glyph="&#xEC12;" />
                </ToggleMenuFlyoutItem.Icon>
            </ToggleMenuFlyoutItem>

        </MenuFlyout>
    </Button.Flyout>
</Button>

Expected behavior

A property to configure the automatic closing behavior of the MenuFlyout.

Screenshots

20241210-0815-14.8041377.mp4

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

@HotCakeX HotCakeX added the bug Something isn't working label Dec 10, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 10, 2024
@DHancock
Copy link

You obviously haven't found the Closing event which allows you to cancel the flyout closing in your event handler.

@HotCakeX
Copy link
Author

You obviously haven't found the Closing event which allows you to cancel the flyout closing in your event handler.

@AndrewKeepCoding suggested this method and it's solved my problem.
https://github.com/HotCakeX/Harden-Windows-Security/pull/452/files

@karkarl
Copy link
Contributor

karkarl commented Dec 12, 2024

@HotCakeX Thanks for chiming in and providing a solution. Closing as there's a valid workaround.

@karkarl karkarl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@karkarl karkarl removed the needs-triage Issue needs to be triaged by the area owners label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants