Change Background of WP7 Application if Theme is altered

后端 未结 5 583
清歌不尽
清歌不尽 2021-01-16 05:19

I need to change the Background Image of my Application if user changes theme from \"Light\" to \"Dark\" or vice-vesa in code behind. I hop

5条回答
  •  花落未央
    2021-01-16 05:50

    You can check if the dark theme is in use with this simple check:

    public static bool CurrentThemeIsDark
    {
      get
        {
          return (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible;
        }
    }
    

提交回复
热议问题