Search code examples
c#uwpuwp-xamlwindows-10-mobiletemplate10

Notification bar appears all white in light mode


I'm using Template 10 and in Windows 10 Mobile when I choose the light mode, the notifications bar appears all white

http://imgur.com/F6T7TKy.png

and can not see the notifications, the hours, etc.

In the dark mode everything seems fine image:

http://imgur.com/j7nXoee.png

How do I solve this?


Solution

  • I do this in my hamburger's override for UIElement CreateRootElement() after my database setup/migrations are done.

     if(Template10.Utils.DeviceUtils.Current().IsPhone()){
       var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
       if(statusBar != null)
       {  
           if(Application.Current.RequestedTheme == ApplicationTheme.Light)
              //background && foreground or combination, and dependent on color choices
              statusBar.ForegroundColor = Windows.UI.Colors.Black;
          else if(Application.Current.RequestedTheme == ApplicationTheme.Dark
              statusBar.ForegroundColor = Windows.UI.Colors.White;
      }
    }
    

    Template10 already has a lot of the logic built in just have to know where it is. As @Jay Zuo said you have to also include the Mobile reference as well..