2
A
回答
4
好吧我想通了。在StandardStyles.xaml中有
在這裏,您可以爲每個不同的主題添加相同的實體刷子元素。
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="#CEE3F8"></SolidColorBrush>
<SolidColorBrush x:Key="ListViewItemPointerOverBackgroundThemeBrush" Color="#E0E0E0"></SolidColorBrush>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="#CEE3F8"></SolidColorBrush>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="#CEE3F8"></SolidColorBrush>
<SolidColorBrush x:Key="HeaderBrush" Color="#FF8AA1B8">
</SolidColorBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="HeaderBrush" Color="#FFCEE3F8">
</SolidColorBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
在這裏,我添加了一個「光」的主題,並增加了一個名爲「HeaderBrush」的主題2固體刷。
要實現這個畫筆,只需將它作爲資源添加到元素即可。像這樣...
<AppBar x:Name="BottomAppBar1" Padding="10,0,10,0" BorderBrush="Blue" BorderThickness="0 1 0 0" Background="{ThemeResource HeaderBrush}" AutomationProperties.Name="Bottom App Bar" Opened="BottomAppBar1_Opened" Closed="BottomAppBar1_Closed">
在這裏,我將刷子設置爲背景顏色,現在它隨主題自動更改。
相關問題
- 1. 在XAML中應用自定義畫筆
- 2. 是否可以在Windows 7上創建WinRT應用程序?
- 3. 在XAML中創建自定義填充畫筆
- 4. winrt是否可以在資源庫中定義筆刷顏色
- 5. 是否可以在Expression Engine 2.x中創建自定義CodeIgniter應用程序
- 6. 是否可以在WinRT中創建IME?
- 7. 可以在WinRT XAML應用程序中混用Direct3D內容嗎?
- 8. 創建自定義圖案畫筆
- 9. 是否可以爲我的應用程序創建自定義鍵盤?
- 10. 是否可以創建一個自定義的動畫MKAnnotationView?
- 11. 在WP7中創建自定義應用程序主題時出現問題
- 12. 在Rails應用程序中創建自定義主鍵
- 13. WinRT XAML自定義轉換
- 14. 是否可以創建WinRT服務
- 15. WinRT - 是否可以創建服務?
- 16. 如何創建自定義主題並在Android應用程序中使用它
- 17. 是否可以創建沒有任何主題的簡單應用程序?
- 18. Android - 是否可以創建自定義庫以在多個應用程序中使用?
- 19. 是否可以在XAML中創建自己的小部件?
- 20. 是否可以自定義應用程序圖標徽章:Xcode?
- 21. 是否可以在Android的應用程序中創建App Widget?
- 22. 是否可以在VB6中創建POSIX應用程序
- 23. 是否可以在iOS中創建透明應用程序
- 24. 自定義Grails創建應用程序
- 25. 是否可以在Amazon Webstore中創建自定義小部件?
- 26. 是否可以在Doxygen中創建自定義對象類型?
- 27. 是否可以在Laravel模型中創建自定義關係?
- 28. 是否可以在Sencha Touch中創建自定義控件?
- 29. 是否可以在Objective-C中創建自定義指令?
- 30. 是否可以在Subversion中創建自定義掛鉤事件
我們如何才能在UWP中完成同樣的事情? –