當向上手勢或者鼠標右鍵的時候會顯示AppBar,AppBar分爲頂部TopAppBar、底部BottomBar兩塊,建議把主要操作放到底部,頂部有特殊意義再放。
Xaml中Page的TopAppBar、BottomAppBar兩個屬性賦值,AppBar類型,然後Content內容自由繪製。一般繪製橫向的圓形圖標,一般採用StandradStyles.xaml中預置的**AppBarBottonStyle樣式,用到哪個反註釋哪個,AutomationProperties.Name設置顯示的文本。用法:<Button Style="{StaticResource EditAppBarButtonStyle}" AutomationProperties.Name="編輯"></Button>
IsOpen打開狀態(可以實現程序打開時默認AppBar顯示);IsSticky是否釘住;Opened、Closed打開關閉事件。
<Page.TopAppBar>
<AppBar>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource PlayAppBarButtonStyle}" AutomationProperties.Name="刪除"></Button>
<Button Style="{StaticResource EditAppBarButtonStyle}" AutomationProperties.Name="編輯"></Button>
</StackPanel>
</AppBar>
</Page.TopAppBar>
高級容器
ProgressBar進度條:IsIndeterminate模式
ProgressRing圓形的不確定進度條,IsActive屬性表示是否活動
ToggleSwitch開關控件,IsOn是否打開,OffContent、OnContent、Header關閉、打開、頭部的顯示內容;Toggled更改事件;
ScrollViewer用於顯示大內容,顯示尺寸不夠則可以通過滾動條控制。
HorizontalScrollBarVisibility、VerticalScrollBarVisibility控制滾動條顯示。
程序的配置
Package.appxmaifest
徽標、寬徽標、小徽標、初始屏幕,注意png格式、尺寸要求
【功能】中配置程序的特殊操作權限,比如操作麥克風,則要勾選“麥克風”,否則調用對應的類會報錯。