public virtual object Convert(object v, Type t, object p, System.Globalization.CultureInfo c) { return(new SolidColorBrush(ColorDef.FromUInt((uint)v))); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { var settings = (Settings)DataContext; if (settings != null) { initializingColor = true; comboBox0.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x00])); comboBox1.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x01])); comboBox2.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x02])); comboBox3.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x03])); comboBox4.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x04])); comboBox5.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x05])); comboBox6.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x06])); comboBox7.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x07])); comboBox8.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x08])); comboBox9.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x09])); comboBox10.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x0A])); comboBox11.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x0B])); comboBox12.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x0F])); comboBox13.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ContentColorList[0x10])); comboBox_reserveNormal.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ReserveRectColorNormal)); comboBox_reserveNo.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ReserveRectColorNo)); comboBox_reserveNoTuner.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ReserveRectColorNoTuner)); comboBox_reserveWarning.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.ReserveRectColorWarning)); comboBox_colorTitle1.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.TitleColor1)); comboBox_colorTitle2.SelectedIndex = Math.Max(0, ColorDef.BrushNames.IndexOfKey(settings.TitleColor2)); initializingColor = false; button0.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x00])); button1.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x01])); button2.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x02])); button3.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x03])); button4.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x04])); button5.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x05])); button6.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x06])); button7.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x07])); button8.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x08])); button9.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x09])); button10.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x0A])); button11.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x0B])); button12.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x0F])); button13.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x10])); button14.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x11])); button15.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x12])); button16.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x13])); button17.Background = new SolidColorBrush(ColorDef.FromUInt(settings.ContentCustColorList[0x14])); button_colorTitle1.Background = new SolidColorBrush(ColorDef.FromUInt(settings.TitleCustColor1)); button_colorTitle2.Background = new SolidColorBrush(ColorDef.FromUInt(settings.TitleCustColor2)); listBox_tab.Items.Clear(); foreach (CustomEpgTabInfo info in settings.CustomEpgTabList) { listBox_tab.Items.Add(info); } if (listBox_tab.Items.Count > 0) { listBox_tab.SelectedIndex = 0; } } }