【发布时间】:2014-06-15 09:22:01
【问题描述】:
我在app.xaml 中定义了主题。当用户在设置中更改手机主题时,它适用于Light 和Dark。
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="MyAppBackground" Color="Black"/>
<SolidColorBrush x:Key="MyAppAccentColor" Color="White"/>
<SolidColorBrush x:Key="MyAppTextColor" Color="Red"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="MyAppBackground" Color="White"/>
<SolidColorBrush x:Key="MyAppAccentColor" Color="Black"/>
<SolidColorBrush x:Key="MyAppTextColor" Color="Yellow"/>
</ResourceDictionary>
<ResourceDictionary x:Key="CustomTheme1">
<SolidColorBrush x:Key="MyAppBackground" Color="Blue"/>
<SolidColorBrush x:Key="MyAppAccentColor" Color="Green"/>
<SolidColorBrush x:Key="MyAppTextColor" Color="White"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
但我希望能够在应用程序中将主题更改为CustomTheme1。在我可以设置的 xaml
RequestedTheme="Light"
但它没有我的自定义主题。
这是一个 windows phone 8.1 应用程序
【问题讨论】:
标签: c# xaml windows-phone-8 windows-runtime windows-phone