I have developed a windows phone application, i want that app to be run in light theme, irrespective of what user have set. means is there any way to set a default theme for the windows phone 8 app.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can use Jeff Wilcox's
ThemeManager
Add it to your project (there is a NuGet package available) and call it from
App()
constructor.You can find usage example on his website.
From http://developergoodies.blogspot.nl/2012/10/force-windows-phone-theme.html
(Tested and verified; get the themes; copied from resource to prevent future inaccessibility)
Answer
When the UI is designed specially for the dark theme it won't look well on the light theme, or vice versa.
To prevent this the application can force the default dark or light theme.
In the application class' constructor put this code to force the dark theme:
Or this code to force the light theme:
Anywhere in your project put this method:
The code assumes that the projects contains the files DarkStyles.xaml and LightStyles.xaml in a folder named Themes.
Call this method in your app constructor
For Windows phone 8.1 you can use:
Or
Source : Windows phone 8 How to be always on one theme even if phone's theme changed