本文介绍了Silverlight中的动态主题4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的App.xaml有这个。 


< ResourceDictionary> 
< ResourceDictionary.MergedDictionaries>
< ResourceDictionary Source =" Themes / RedTheme.xaml" />
< ResourceDictionary Source =" Themes / BlueTheme.xaml" />
< ResourceDictionary Source =" Themes / GreenTheme.xaml" />
< /ResourceDictionary.MergedDictionaries>
< / ResourceDictionary>

 


目前最后输入的内容(greenTheme)将是隐含的主题。有没有人知道我在运行时动态更改这些主题的方法。

解决方案

My App.xaml has this. 

<ResourceDictionary>
   <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="Themes/RedTheme.xaml"/>
       <ResourceDictionary Source="Themes/BlueTheme.xaml"/>
       <ResourceDictionary Source="Themes/GreenTheme.xaml"/>
   </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

At the moment whatever is entered last(greenTheme) will be the implicit theme. Does anyone know a way for me to dynamically change between these themes at runtime.

解决方案


这篇关于Silverlight中的动态主题4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 14:07