gpt4 book ai didi

c# - 如何在 Windows Phone 8.1 中使用 ThemeResources 更改主题?

转载 作者:太空宇宙 更新时间:2023-11-03 15:54:26 26 4
gpt4 key购买 nike

我在 app.xaml 中定义了主题。当用户在设置中更改手机主题时,它适用于 LightDark

<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 应用

最佳答案

目前您只能设置浅色或深色主题。除了自定义 Light 和 Dark 主题外,没有在 RequestedTheme 中添加自定义主题的选项。

关于c# - 如何在 Windows Phone 8.1 中使用 ThemeResources 更改主题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24228209/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com