windowsphone 8.1命令栏

windowsphone 8.1 commandbar

现在我正在使用 VS2015 和 C# 和 XAML 制作 Windows Phone 8.1 应用程序。 并想了解 Commandbar。

我只使用辅助命令栏。所以,我想压缩 primary 的 space,当 Commandbar 弹出时。但我无法解决这个问题。

Ideal Image, commandbar's height short

现在我的代码在这里。

<Page.BottomAppBar>
    <CommandBar ClosedDisplayMode="Minimal" Background="Tomato">
        <CommandBar.SecondaryCommands>
            <AppBarButton x:Name="appBarAboutButton" 
                          Label="about"
                          Click="appBarAboutButton_Click"/>
        </CommandBar.SecondaryCommands >
    </CommandBar>
</Page.BottomAppBar>

请告诉我如何解决这个问题。

目前这是命令栏的预期行为,没有解决方法。但是在命令栏中有一个名为 Content 的属性。您可以尝试一下,看看它是否符合您的需要。

CommandBar has 3 properties you can use to add content and commands: Content, PrimaryCommands, and SecondaryCommands. You can add any XAML elements to the content area by setting the Content property.

查看此 link 了解更多信息 https://msdn.microsoft.com/en-in/library/windows/apps/windows.ui.xaml.controls.commandbar.aspx