0
應用在我的設置頁面我有一個listPicker
控制,即有兩個值Dark
和Light
當我選擇Dark
從listpicker
我想改變背景Silver
前景色white
按鈕的背景顏色到Black
,按鈕前景色爲white
和強調色彩是應用程序的black
,和我做象下面這樣:不變色FO在WP8 C#
private void themelistPicker1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListPickerItem lpi = (sender as ListPicker).SelectedItem as ListPickerItem;
themename = lpi.Content.ToString();
if (themename == "Dark")
{
SolidColorBrush brush = new SolidColorBrush();
brush.Color = Color.FromArgb(255, 192, 192, 192);
App.RootFrame.Background = brush;
((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = Colors.Black;
((Color)Resources["PhoneForegroundColor"])= Colors.Black;
}
else
{
SolidColorBrush brush = new SolidColorBrush();
brush.Color = Color.FromArgb(255, 255, 255, 255);
App.RootFrame.Background = brush;
((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = Colors.Blue;
((Color)Resources["PhoneForegroundColor"])= Colors.Black;
}
但它僅更改設置的頁面的背景,強調色彩色不是所有的日e應用程序,也不會更改應用程序的前景和按鈕顏色,爲什麼?
請提出我,等待回覆。
感謝
try =>(App.Current.Resources [「PhoneAccentBrush」]與SolidColorBrush一樣).COlor = Colors.Black; – MatDev8 2014-09-22 13:23:54