Loading...
Loading...
Guide implementation of the Syncfusion WinUI DropDown Color Palette control for color selection in Windows desktop applications. Use this skill when implementing color selection dropdowns, theme color support, custom color palettes, split-mode buttons, or the More Colors dialog. Covers dropdown customization, palette structure, and color-based UI interactions.
npx skill4agent add syncfusion/winui-ui-components-skills syncfusion-winui-dropdown-color-paletteSfDropDownColorPalette| Section | Purpose |
|---|---|
| Selected Color Button | Displays currently selected color; clicking opens palette |
| Automatic Color | Quick access to default color (usually black) |
| Theme Colors | Predefined theme colors with shade variants |
| Standard Colors | 10 standard colors (red, green, blue, yellow, etc.) |
| Recently Used | Colors selected from More Colors dialog |
| More Colors... | Opens spectrum dialog for any color |
Syncfusion.Editors.WinUI<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:editors="using:Syncfusion.UI.Xaml.Editors">
<Grid>
<editors:SfDropDownColorPalette x:Name="colorPalette" />
</Grid>
</Page>using Syncfusion.UI.Xaml.Editors;
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
var colorPalette = new SfDropDownColorPalette();
grid.Children.Add(colorPalette);
}
}<editors:SfDropDownColorPalette SelectedBrush="Yellow" x:Name="palette" />// Get the selected color
var selectedBrush = palette.SelectedBrush as SolidColorBrush;
if (selectedBrush != null)
{
Color selectedColor = selectedBrush.Color;
}
// Set a new color
palette.SelectedBrush = new SolidColorBrush(Colors.Red);<editors:SfDropDownColorPalette
SelectedBrushChanged="Palette_SelectedBrushChanged"
x:Name="palette" />private void Palette_SelectedBrushChanged(object sender, SelectedBrushChangedEventArgs e)
{
var oldBrush = e.OldBrush as SolidColorBrush;
var newBrush = e.NewBrush as SolidColorBrush;
// Apply color somewhere
textBlock.Foreground = newBrush;
}<editors:SfDropDownColorPalette
DropDownMode="Split"
Command="{x:Bind ApplyColorCommand}"
x:Name="palette" />private ICommand applyColorCommand;
public ICommand ApplyColorCommand => applyColorCommand;
public void ApplyColorToSelectedText(object param)
{
// Apply the currently selected color
richTextBox.Document.Selection.CharacterFormat.BackgroundColor =
(palette.SelectedBrush as SolidColorBrush).Color;
}<editors:SfDropDownColorPalette
DropDownPlacement="BottomEdgeAlignedRight"
x:Name="palette" />AutoBottomEdgeAlignedLeftBottomEdgeAlignedRightTopEdgeAlignedLeftTopEdgeAlignedRight<editors:SfDropDownColorPalette
DropDownOpened="Palette_DropDownOpened"
DropDownClosed="Palette_DropDownClosed"
x:Name="palette" />private void Palette_DropDownOpened(object sender, EventArgs e)
{
// Palette opened
}
private void Palette_DropDownClosed(object sender, EventArgs e)
{
// Palette closed
}| Property | Type | Purpose |
|---|---|---|
| | Gets/sets the currently selected color (default: Black) |
| | Position of dropdown relative to button (default: Auto) |
| | Dropdown or Split mode (default: Dropdown) |
| | Command executed when button clicked (Split mode) |
| | Customize selected color button appearance |
| | Customize dropdown arrow button (Split mode) |