How to override Accent color and Default background color windows phone 8

二次信任 提交于 2019-12-23 04:26:30

问题


I want to change the Accent color in my whole application to a custom color.
Currently it's coming whatever is selected in "Settings"
Also need to change the default background color for pages


回答1:


You can put this in App.xml.cs constructor

//This will change the default accent color
(App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Colors.Green;

//This will change the default background color for pages
(App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White;

//other code


Similarly you can change the other Brush/Color specified in Theme resources for Windows Phone



来源:https://stackoverflow.com/questions/17102716/how-to-override-accent-color-and-default-background-color-windows-phone-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!