CommandBar 在 windows 10 通用应用程序的纵向模式下始终可见

CommandBar is always visible in portrait mode with windows 10 universal app

我不知道我是否遗漏了什么,但我对此表示怀疑,在我看来它更像是一个错误,但我想我会先检查这里以防万一。

这是我的代码:

<Page.BottomAppBar>
    <CommandBar x:Name="bottomAppBar"
                Background="{ThemeResource SystemControlBackgroundAccentBrush}" 
                Visibility="Collapsed" 
                IsOpen="False" 
                ClosedDisplayMode="Compact" 
                IsSticky="False">
        <AppBarButton x:Name="btnSearch" Label="Search" 
         Icon="Find" Foreground="White" />
    </CommandBar>
</Page.BottomAppBar>

在我的 phone 上以纵向模式显示时,它始终显示命令栏,而当我旋转 phone(横向)时,它可以正常隐藏。

奇怪的是,XAML 编辑器总是显示命令栏,无论编辑器设置为哪个方向。

模拟器和实际都出现这个问题phone。

我还没有通过代码隐藏尝试过,因为我正在使用 MVVM,我想将 属性 绑定到 Visibility 或 IsOpen 属性,但稍后会在需要时尝试,我会但希望不会归结为这个。

有什么想法吗?

谢谢。

蒂埃里

我在 Windows 10 Mobile emulator build 10586 中测试了这段代码。命令栏在纵向和横向中不显示。