【发布时间】:2012-04-11 08:42:43
【问题描述】:
如何将我的 XAML Metro 应用程序设置为使用浅色主题(如 VS 11 Beta Platform Dock 中所示) 它默认为我不喜欢的黑暗主题
谢谢
【问题讨论】:
标签: xaml themes microsoft-metro windows-runtime
如何将我的 XAML Metro 应用程序设置为使用浅色主题(如 VS 11 Beta Platform Dock 中所示) 它默认为我不喜欢的黑暗主题
谢谢
【问题讨论】:
标签: xaml themes microsoft-metro windows-runtime
如果您还没有查看this,此链接可能会有所帮助。
【讨论】:
您可以像这样在 app.xaml 中设置主题:
<Application
..
RequestedTheme="Light">
【讨论】:
您也可以通过在app.xaml.cs 的构造函数中设置App.Current.RequestedTheme 以编程方式执行此操作。示例::
public App()
{
this.InitializeComponent();
App.Current.RequestedTheme = ApplicationTheme.Light;
}
不过,将其设置在稍后的时间点会引发异常。更多详情:Blog post about this
【讨论】: