前七節將Ribbon的功能大致介紹了一番,本節來介紹一些特殊控件的使用
DropDownButton控件
當前控件是顯示下拉功能的基本組件,其配合Gallery能實現諸多特殊功能,代碼如下所示
| <Fluent:DropDownButton Header="Pink" Icon="Images\Pink.png" LargeIcon="Images\PinkLarge.png"> <Fluent:Gallery> <Image Source="Images\RedLarge.png" Stretch="None" /> <Image Source="Images\GreenLarge.png" Stretch="None" /> <Image Source="Images\BlueLarge.png" Stretch="None" /> </Fluent:Gallery> </Fluent:DropDownButton> |
當前主要顯示一個下拉控件,顯示一些下拉顯示,如下圖

Gallery 控件
用於顯示一個組合列表的功能,其基本代碼形式如下:
| <Fluent:RibbonGroupBox Header="列表組" > <Fluent:Gallery> <Image Source="Images\RedLarge.png" Stretch="None" /> <Image Source="Images\GreenLarge.png"Stretch="None" /> <Image Source="Images\BlueLarge.png" Stretch="None" /> </Fluent:Gallery> </Fluent:RibbonGroupBox> |
其顯示效果如圖

ColorGallery控件
用於實現顏色的選擇控件,其繼承自Gallery
| <Fluent:ColorGallery Mode="StandardColors" SelectedColor="{Binding ColorViewModel.StandardColor, Mode=TwoWay}" /> |
其顯示效果如圖

Spinner控件
| <Fluent:Spinner KeyTip="KA" InputWidth="75" Format="0 px" Header="數值:" Icon="Images/Warning.png" /> |
其顯示效果如圖

還有一些不太常用的控件,可以查看源碼,細細分析。
