We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create custom palette using ColorPickerPalette?

Setting IsCustomTabVisible and SetCustomColors properties

Set IsCustomTabVisible=Visible to make the custom tab visible in ColorPickerPalette. Set SetCustomColors=True to add your own custom colors in the custom tab.

Create custom colors

Create a collection of custom colors that need to be displayed. Custom colors are the instance of CustomColor class.

Setting CustomColorsCollection property

Set the collection of custom colors to CustomColorsCollection property.

Customizing tab header

You can customize the custom tab header text by setting the property CustomHeaderText. You can collapse the header by setting the property CustomHeaderVisibility to Collapsed.

MainWindow.xaml

 

MainWindow.xaml.cs

The above code example creates a custom palette in ColorPickerPalette as follows.

Article ID: Published Date: Last Revised Date: Platform: Control:
3236 01/13/2015 01/13/2015 WPF ColorPickerPalette
Did you find this information helpful?
Comments
Jochen Dec 08, 2016
Can you please provide the InitializeComponent code in VB.net ?


Reply
Victory Jessie Selvam D [Syncfusion] Dec 09, 2016
Imports System.Windows.Media

Class MainWindow
    Dim colors As New System.Collections.ObjectModel.ObservableCollection(Of Syncfusion.Windows.Tools.Controls.CustomColor)()

    Public Sub New()
        InitializeComponent()
        colors.Add(New Syncfusion.Windows.Tools.Controls.CustomColor() With {.Color = System.Windows.Media.Colors.RosyBrown, .ColorName = "My RosyBrown"})
        colors.Add(New Syncfusion.Windows.Tools.Controls.CustomColor() With {.Color = System.Windows.Media.Colors.YellowGreen, .ColorName = "My YellowGreen"})
        colors.Add(New Syncfusion.Windows.Tools.Controls.CustomColor() With {.Color = System.Windows.Media.Color.FromArgb(&HFF, &H0, &H0, &H0), .ColorName = "My Black"})
        colors.Add(New Syncfusion.Windows.Tools.Controls.CustomColor() With {.Color = System.Windows.Media.Color.FromArgb(&H78, &H0, &H0, &HFF), .ColorName = "My Transparent Blue"})
        color.CustomColorsCollection = colors
    End Sub
End Class
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon