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 關注
- 142 瀏覽
添加回答
舉報