本文介绍了ListPickerFlyout 在 Windows Phone 8.1 中忽略父页面的 RequestedTheme的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我在 WinRT Windows Phone 8.1 应用程序中有一个 Page.此页面将 RequestedTheme 设置为 ElementTheme.Light.系统主题(在系统设置中设置)设置为深色.

I have a Page in a WinRT Windows Phone 8.1 application. This Page has RequestedTheme set to ElementTheme.Light. The system theme (as set in system settings) is set to dark.

当我打开一个 ListPickerFlyout(使用 Button.Flyout)时,结果如下:

When I open a ListPickerFlyout (using Button.Flyout), the result is the following:

看起来,前景色适当地更改为黑色,但背景保持深色主题(非常深的灰色).

It seems, that the foreground color appropriately changes to black, but the background stays dark-themed (a very dark gray).

浮出控件上没有 Background 属性,有没有办法强制它符合页面的 RequestedTheme?

There isn't a Background property on the flyout, is there a way to force it to comply with the Page's RequestedTheme?

推荐答案

好问题!

在应用程序资源中,您可以为 Light 主题覆盖一个名为 FlyoutBackgroundThemeBrush 的资源.

In the application resources, you can override a resource called FlyoutBackgroundThemeBrush for Light themes.

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.ThemeDictionaries>
            <ResourceDictionary x:Key="Light">
                <SolidColorBrush x:Key="FlyoutBackgroundThemeBrush" Color="Green" />
            </ResourceDictionary>
        </ResourceDictionary.ThemeDictionaries>
    </ResourceDictionary>
</Application.Resources>

这将使概念验证变得绿色.:)

This will make it green for proof of concept. :)

这篇关于ListPickerFlyout 在 Windows Phone 8.1 中忽略父页面的 RequestedTheme的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 01:18