Hiding the ellipsis button (more button) in CommandBar in UWP (Windows 10)
Asked Answered
B

2

6

I am using a commandbar in my project (UWP), however, I realized there is an ellipsis button in the commandbar by default. Is there any way where by I can hide/remove it?

Ellipsis button

Here's my code:

<Page.BottomAppBar>
    <CommandBar 
        Background="{StaticResource CitiKioskBackgroundBrush}"
        IsOpen="True"
        IsSticky="True"
        Name="appBarName"
        Visibility="Collapsed"
        >
        <CommandBar.PrimaryCommands>
            <AppBarButton Name="SettingAppBarButton"
                      Icon="Setting"
                      Label="Settings" 
                      Foreground="White" Click="SettingAppBarButton_Click"/>
        </CommandBar.PrimaryCommands>
    </CommandBar>
</Page.BottomAppBar>
Berns answered 3/10, 2017 at 1:57 Comment(0)
M
13

You can use the OverflowButtonVisibility property:

<CommandBar OverflowButtonVisibility="Collapsed"></CommandBar>

Monotint answered 5/10, 2017 at 18:24 Comment(2)
Hi, thanks for the help! I have tried the codes, and it shows a XBF syntax error '0x09C4' :Property Not Found. Why is that so?Berns
@Berns This property is introduced from Windows 10 Anniversary Edition (introduced v10.0.14393.0). Please make sure that your project's min version is 14393 and target version is 14393 or greater.Vociferation
Z
1

As there is no property to disable the MoreButton of the CommandBar, you'll have to copy the CommandBar template, remove the MoreButton element from it, and apply the template to your CommandBar instance. Eventually, you have to modify further parts of the template to make it function correctly.

Zoarah answered 3/10, 2017 at 8:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.