2 回答

TA贡献1829条经验 获得超7个赞
官方文档中有备注,只有在升级使用 AppBar 的 Universal Windows 8 应用时才应该使用 AppBar,并且需要尽量减少改动。对于 Windows 10 中的新应用,我们建议改用该CommandBar控件。请尝试CommandBar如下使用。
<CommandBar>
<AppBarButton Label="Reset" Icon="AllApps" Click="ButtonResetGrid" />
<AppBarButton Label="Export" Icon="AllApps" Click="ButtonExport" />
<AppBarButton Label="Refresh" Icon="AllApps" Click="ButtonRefreshCode" />
<CommandBar.SecondaryCommands>
<AppBarButton Icon="Like" Label="Like" />
<AppBarButton Icon="Dislike" Label="Dislike" />
</CommandBar.SecondaryCommands>
<CommandBar.Content>
<TextBlock Text="Now playing..." Margin="12,14"/>
</CommandBar.Content>
</CommandBar>
更新
如果你想让所有 AppBarButtons conllection 离开,你需要像链接一样自定义 CommandBar 样式。

TA贡献1806条经验 获得超8个赞
你能试试吗,因为它可能会起作用:
<Page.TopAppBar>
<AppBar x:Name="AppBar" IsSticky="True" Margin="0,0,0,0" IsOpen="True">
<StackPanel Orientation="Horizontal">
<Button Content="Reset" Width="140" Height="80" Click="ButtonResetGrid_Click"/>
<Button Content="Export" Width="140" Height="80" Icon="AllApps" Click="ButtonExport_Click"/>
<Button Content="Refresh" Width="140" Height="80" Icon="AllApps" Click="ButtonRefreshCode_Click"/>
</StackPanel>
</AppBar>
</Page.TopAppBar>
- 2 回答
- 0 关注
- 123 浏览
添加回答
举报