Ejemplo n.º 1
0
        /// <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">
        ///  &lt;%= Html.Kendo().ColorPalette()
        ///             .Name("ColorPalette")
        ///             .Palette(ColorPickerPalette.WebSafe)
        /// %&gt;
        /// </code>
        /// </example>
        public ColorPaletteBuilder Palette(ColorPickerPalette palette)
        {
            Component.PaletteColors = null;
            Component.Palette       = palette;

            return(this);
        }
Ejemplo n.º 2
0
        /// <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">
        ///  &lt;%= Html.Kendo().ColorPicker()
        ///             .Name("ColorPicker")
        ///             .Palette(ColorPickerPalette.WebSafe)
        /// %&gt;
        /// </code>
        /// </example>
        public EditorColorPickerToolBuilder Palette(ColorPickerPalette palette)
        {
            tool.PaletteColors = null;
            tool.Palette       = palette;

            return(this);
        }
Ejemplo n.º 3
0
            public object Create(PropertyInfo propertyInfo)
            {
                _editor = new ColorPickerPalette();
                _editor.SetCurrentValue(ColorPickerPalette.AutomaticColorProperty, new SolidColorBrush((Color)ColorConverter.ConvertFromString("#DF2935")));

                return(_editor);
            }
Ejemplo n.º 4
0
        /// <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">
        ///  &lt;%= Html.Kendo().ColorPicker()
        ///             .Name("ColorPicker")
        ///             .Palette(ColorPickerPalette.WebSafe)
        /// %&gt;
        /// </code>
        /// </example>
        public EditorColorPickerToolBuilder Palette(ColorPickerPalette palette)
        {
            tool.PaletteColors = null;
            tool.Palette = palette;

            return this;
        }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
        public static void PropertyChangedCallback(DependencyObject depObj, DependencyPropertyChangedEventArgs args)
        {
            ColorPickerPalette c = depObj as ColorPickerPalette;

            if (c != null)
            {
                c.ColorChanged += c_SelectedColorChanged;
            }
        }
Ejemplo n.º 7
0
        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);
                }
            }
        }
Ejemplo n.º 8
0
        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;
            }
        }
Ejemplo n.º 9
0
 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();
 }