【问题标题】:How to change theme using ThemeResources in Windows Phone 8.1?如何在 Windows Phone 8.1 中使用 ThemeResources 更改主题?
【发布时间】:2014-06-15 09:22:01
【问题描述】:

我在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 应用程序

【问题讨论】:

    标签: c# xaml windows-phone-8 windows-runtime windows-phone


    【解决方案1】:

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

    【讨论】:

    • 那么还有其他自定义主题吗?没有 ThemeResources
    • 听起来像是一个不同的问题,我想我以前见过有人问过 winrt。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-28
    • 1970-01-01
    • 2011-12-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多