在codeplex的mui中,app.xaml就像这样
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" />
<ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/modernui.light.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
但每次运行程序时如何在代码后面选择FirstFloor.ModernUI;component/Assets/modernui.light.xaml"
代替FirstFloor.ModernUI;component/Assets/modernui.light.xaml"
?
答案 0 :(得分:1)
ModernUI源代码附带一个示例应用程序,向您展示如何完全按照您的要求执行操作。
该库有一个AppearanceManager类。设置当前实例ThemeSource属性:
AppearanceManager.Current.ThemeSource = AppearanceManager.LightThemeSource;