/// <summary> /// Sets the range of colors that the user can pick from. /// </summary> /// <param name="palette">One of the preset palettes of colors</param> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().ColorPalette() /// .Name("ColorPalette") /// .Palette(ColorPickerPalette.WebSafe) /// %> /// </code> /// </example> public ColorPaletteBuilder Palette(ColorPickerPalette palette) { Component.PaletteColors = null; Component.Palette = palette; return(this); }
/// <summary> /// Sets the range of colors that the user can pick from. /// </summary> /// <param name="palette">One of the preset palettes of colors</param> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().ColorPicker() /// .Name("ColorPicker") /// .Palette(ColorPickerPalette.WebSafe) /// %> /// </code> /// </example> public EditorColorPickerToolBuilder Palette(ColorPickerPalette palette) { tool.PaletteColors = null; tool.Palette = palette; return(this); }
public object Create(PropertyInfo propertyInfo) { _editor = new ColorPickerPalette(); _editor.SetCurrentValue(ColorPickerPalette.AutomaticColorProperty, new SolidColorBrush((Color)ColorConverter.ConvertFromString("#DF2935"))); return(_editor); }
/// <summary> /// Sets the range of colors that the user can pick from. /// </summary> /// <param name="palette">One of the preset palettes of colors</param> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().ColorPicker() /// .Name("ColorPicker") /// .Palette(ColorPickerPalette.WebSafe) /// %> /// </code> /// </example> public EditorColorPickerToolBuilder Palette(ColorPickerPalette palette) { tool.PaletteColors = null; tool.Palette = palette; return this; }
private static void Colorpicker_MoreColorWindowOpening(object sender, MoreColorCancelEventArgs args) { ColorPickerPalette colorpicker = sender as ColorPickerPalette; if (colorpicker.Parent is StackPanel && (colorpicker.Parent as StackPanel).Parent is Popup) { ((colorpicker.Parent as StackPanel).Parent as Popup).IsOpen = false; } }
public static void PropertyChangedCallback(DependencyObject depObj, DependencyPropertyChangedEventArgs args) { ColorPickerPalette c = depObj as ColorPickerPalette; if (c != null) { c.ColorChanged += c_SelectedColorChanged; } }
static void c_SelectedColorChanged(object sender, DependencyPropertyChangedEventArgs e) { ColorPickerPalette box = (sender as ColorPickerPalette); if (box != null) { ICommand command = box.GetValue(CommandProperty) as ICommand; if (command != null) { command.Execute(box.Color); } } }
public static void PropertyChangedCallback(DependencyObject depObj, DependencyPropertyChangedEventArgs args) { RibbonMenuItem listview = depObj as RibbonMenuItem; ColorPickerPalette colorpicker = depObj as ColorPickerPalette; if (listview != null) { listview.Click += listview_Click; } if (colorpicker != null) { colorpicker.MoreColorWindowOpening += Colorpicker_MoreColorWindowOpening; } }
public override void OnApplyTemplate() { base.OnApplyTemplate(); SearchButton = this.GetTemplateChild("PART_Search") as Button; FindNextButton = this.GetTemplateChild("PART_FindNext") as Button; FindPreviousButton = this.GetTemplateChild("PART_FindPrevious") as Button; CloseButton = this.GetTemplateChild("PART_Close") as Button; ComboBox = this.GetTemplateChild("PART_SearchType") as ComboBox; ComboBox.SelectedIndex = 0; SearchTextBox = this.GetTemplateChild("PART_TextBox") as TextBox; CaseSensitiveSearchCheckBox = this.GetTemplateChild("PART_CaseSensitiveSearch") as CheckBox; SearchOnTextChangeCheckBox = this.GetTemplateChild("PART_SearchOnTextChange") as CheckBox; AdornerLayer = this.GetTemplateChild("PART_AdornerLayer") as AdornerDecorator; SearchColorPickerPalette = this.GetTemplateChild("PART_SearchBrush") as ColorPickerPalette; HighlightColorPickerPalette = this.GetTemplateChild("PART_HighLightBrush") as ColorPickerPalette; SearchColorPickerPalette.Color = Color.FromRgb(255, 255, 0); HighlightColorPickerPalette.Color = Color.FromRgb(250, 160, 122); this.SearchTextBox.Focus(); this.WireEvents(); }