Change Background of WP7 Application if Theme is altered

后端 未结 5 581
清歌不尽
清歌不尽 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 06:02

    If your application is tombstoned, all your controls will be recreated and the new theme will be applied. If you'd like to manage your light/dark specific styles in a similar vein to normal themes, you might want to take a look at a custom ResourceDictionary I blogged about a while back.

    Unfortunately, as of Mango there, is a bug (?) related to fast application switching that causes the theme to remain unchanged in your application. The bug is outlined in this question and its linked posts:

    Is there a bug when changing themes when app is deactivated and reactivated in Windows Phone Mango

    My ResourceDictionary is still useful for the initial startup but it appears, unfortunately, that nothing can be done to workaround the Mango bug.

提交回复
热议问题