我正在为Windows Phone 8.1(运行时应用程序)创建应用程序。我在任何地方都使用ThemeResource动态地拾取当前的前景和背景画笔。但是我面临的一个问题是StatusBar。我将它的颜色设置为PhoneChromeBrush,它将根据主题再次进行更改。我发现前景色和背景色只能从后面的代码中设置。Windows Phone 8.1状态栏主题
这是代码:
var statusBar = StatusBar.GetForCurrentView();
statusBar.BackgroundColor = (App.Current.Resources["PhoneChromeBrush"] as SolidColorBrush).Color;
statusBar.BackgroundOpacity = 1;
statusBar.ProgressIndicator.ProgressValue = 1;
await statusBar.ShowAsync();
什么是改变状态栏的颜色,当主题实际上改变了呢?有什么事情我可以听主题变化?