Пример #1
0
        private void SyncFontColor()
        {
            int colorIdx = AvailableColors.GetFontColorIndex(this.Font.Color);

            this.colorFontChooser.colorPicker.superCombo.SelectedIndex = colorIdx;
            this.colorFontChooser.txtSampleText.Foreground             = this.Font.Color.Brush;
            this.colorFontChooser.colorPicker.superCombo.BringIntoView();
        }
        private void SyncFontColor()
        {
            Log.Debug("In SyncFontColor");
            int colorIdx = AvailableColors.GetFontColorIndex(this.Font.Color);

            this.colorFontChooser.colorPicker.superCombo.SelectedIndex = colorIdx;
            // The following does not work. Why???
            // this.colorFontChooser.colorPicker.superCombo.SelectedValue = this.Font.Color;
            this.colorFontChooser.colorPicker.superCombo.BringIntoView();
        }
Пример #3
0
        public static int GetFontColorIndex(FontColor c)
        {
            AvailableColors brushList  = new AvailableColors();
            int             idx        = 0;
            SolidColorBrush colorBrush = c.Brush;

            foreach (FontColor brush in brushList)
            {
                if (brush.Brush.Color.Equals(colorBrush.Color))
                {
                    break;
                }

                idx++;
            }

            return(idx);
        }
Пример #4
0
 public ColorPickerViewModel()
 {
     this.selectedFontColor = AvailableColors.GetFontColor(Colors.Black);
     this.roFontColors      = new ReadOnlyCollection <FontColor>(new AvailableColors());
 }
Пример #5
0
 public static FontColor GetFontColor(Color c)
 {
     return(AvailableColors.GetFontColor(new SolidColorBrush(c)));
 }
Пример #6
0
        public static FontColor GetFontColor(string name)
        {
            AvailableColors brushList = new AvailableColors();

            return(brushList.GetFontColorByName(name));
        }
Пример #7
0
        public static FontColor GetFontColor(SolidColorBrush b)
        {
            AvailableColors brushList = new AvailableColors();

            return(brushList.GetFontColorByBrush(b));
        }