C# windows phone中的设备主题检测

C# windows phone中的设备主题检测,c#,windows-phone-7,windows-8,windows-phone-8,C#,Windows Phone 7,Windows 8,Windows Phone 8,如何在wp8中获得当前的设备主题,看起来是这样的 Visibility-darkBackgroundVisibility=(Visibility)Application.Current.Resources[“phonedarkthemeviability”] 如果在您的应用程序作为背景时更改了设备主题,则不会返回正确的值。是否有解决方法来了解设备上的当前主题?是否有此属性 Visibility v = (Visibility)Resources["PhoneLightThemeVisibilit

如何在wp8中获得当前的设备主题,看起来是这样的

Visibility-darkBackgroundVisibility=(Visibility)Application.Current.Resources[“phonedarkthemeviability”]


如果在您的应用程序作为背景时更改了设备主题,则不会返回正确的值。是否有解决方法来了解设备上的当前主题?是否有此属性

Visibility v = (Visibility)Resources["PhoneLightThemeVisibility"]; 

if (v == System.Windows.Visibility.Visible)
{
    // Is light theme
}
else
{
    // Is dark theme
}

该应用程序进入后台,当再次拾取时,将使用启动时收集的先前状态变量(注意:启动只调用一次,应用程序激活后,将调用停用事件)。不幸的是,它因此无法检测到。您必须重新启动应用程序以获取新的状态变量

当你更改设备时,它不会返回正确的值。当你将应用程序置于后台时,它会返回旧值