microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.27k stars 674 forks source link

AppBarButton within AppBarElementContainer in CommandBarFlyout.PrimaryCommands behave incorrectly in WIndows App SDK 1.5 #9379

Open zhuxb711 opened 6 months ago

zhuxb711 commented 6 months ago

Describe the bug

AppBarButton within AppBarElementContainer in CommandBarFlyout.PrimaryCommands behave incorrectly as the screenshot below.

Steps to reproduce the bug

Example:

<CommandBarFlyout AlwaysExpanded="True"
                                   Placement="BottomEdgeAlignedLeft"
                                   ShouldConstrainToRootBounds="False">
    <CommandBarFlyout.PrimaryCommands>
        <AppBarElementContainer>
            <StackPanel Orientation="Horizontal">
                <AppBarButton Icon="Copy"  />
                <AppBarButton Icon="Delete"  />
            </StackPanel>
        </AppBarElementContainer>
    </CommandBarFlyout.PrimaryCommands>
</CommandBarFlyout>

Expected behavior

Should be the same as Windows App SDK 1.4.X

Screenshots

With Label: image

Without Label: image

NuGet package version

WinUI 3 - Windows App SDK 1.5.0: 1.5.240227000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

github-actions[bot] commented 6 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

llongley commented 6 months ago

Hi @zhuxb711,

Thanks for reporting this issue!

AppBarElementContainer is intended to support controls that can't normally go in a CommandBarFlyout. You shouldn't need to put an AppBarButton in an AppBarElementContainer. Is there a specific reason why you need to do that?

zhuxb711 commented 6 months ago

@llongley For example, I would like to layout the AppBarButton with other UIElements, not only the AppBarButton itself. AppBarElementContainer supports for the other UIElements but should also supports for the AppBarButton itself, the developer of WinUI should not assume that no AppBarButton within the AppBarElementContainer