天天看點

WPF xaml.cs 設定屬性

//設定背景色
WL8.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A50A8"));
//設定字型顔色
WL8.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFF"));
//設定控件水準對齊
WL8.HorizontalContentAlignment= new System.Windows.HorizontalAlignment.Right;
//設定控件内邊距
WL8.Padding= new Thickness(6, 4, 6, 0);