ListPickerFlyout ignores RequestedTheme of the parent page in Windows Phone 8.1

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

When I open ListPickerFlyout (using Button.Flyout), the result is as follows:

enter image description here

It seems that the foreground color changes accordingly to black, but the background remains dark (very dark gray).

There is no Background property in the drop-down list, is there a way to make it execute the RequestedTheme page?

+6
source share
2 answers

Great question!

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

 <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 to prove the concept. :)

+6
source

The problem is that the pop-ups do not use the RequestedTheme page, but App RequestedTheme.

In this case, the solution should set Application.Current.RequestedTheme = ApplicationTheme.Light in addition to setting Page.RequestedTheme = ElementTheme.Light .

+5
source

Source: https://habr.com/ru/post/970127/


All Articles