我想爲我的Windows 8商店應用程序定義一個默認背景顏色,但是雖然它在XAML編輯器和Blend中正確顯示,但它在Windows 8和Windows RT模擬器上運行時會出現默認的黑色背景。爲什麼重寫ApplicationPageBackgroundThemeBrush不起作用?
我基於「Split App」VS 2012模板創建了一個全新的Windows 8應用程序,並修改了App.xaml以指定ApplicationPageBackgroundThemeBrush的新值。
這是我的App.xaml是什麼樣子:
<Application
x:Class="App3.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App3"
xmlns:localData="using:App3.Data">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- Application-specific resources -->
<x:String x:Key="AppName">App3</x:String>
<!-- Basic foreground and background colours -->
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FF3CA5DC"/>
<SolidColorBrush x:Key="ApplicationPageForegroundThemeBrush" Color="White"/>
</ResourceDictionary>
</Application.Resources>
感謝你的看起來,微軟似乎沒有讓默認模板特別有用,就像這樣,進度條默認粉紅色! – Richard 2013-03-01 09:52:52