0

通常在 Microsoft 示例项目 (XAML) 中,页面上有白色背景色。我怎样才能改变它?示例:http ://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290

4

1 回答 1

2

您问题的具体答案是它受主题控制。查看 App.xaml:

<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
x:Class="ListViewSimple.App"
RequestedTheme="Light" >

请注意, RequestedTheme有一个“Light”主题和一个“Dark”主题属性。

现在,如果您想知道如何将 Light 主题从白色背景切换到黄色背景(顺便说一句,这不是推荐),您可能需要查看此资源以获取覆盖 Metro 应用程序资源。确保如果您确实覆盖,您这样做是经过深思熟虑的;Windows UI 设计理念的首要主题是为用户提供一致的体验。

于 2012-09-02T18:55:11.700 回答