Class SfDropDownColorPicker
Represents a control that lets a user pick a Microsoft.UI.Xaml.Media.SolidColorBrush, Microsoft.UI.Xaml.Media.LinearGradientBrush or Microsoft.UI.Xaml.Media.RadialGradientBrush from a dropdown.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Editors
Assembly: Syncfusion.Editors.WinUI.dll
Syntax
public class SfDropDownColorPicker : SfDropDownBase, IDisposableExamples
<syncfusion:SfDropDownColorPicker>
    <syncfusion:SfDropDownColorPicker.SelectedBrush>
        <SolidColorBrush Color="Green"/>
    </syncfusion:SfDropDownColorPicker.SelectedBrush>
    <syncfusion:SfDropDownColorPicker.ContentTemplate>
        <DataTemplate>
            <StackPanel>
                <Path Data="{StaticResource paint}"/>
                <Rectangle Fill="{Binding}"/>
            </StackPanel>
        </DataTemplate>
    </syncfusion:SfDropDownColorPicker.ContentTemplate>
</syncfusion:SfDropDownColorPicker>SfDropDownColorPicker configured to choose only solid color, and hide slider color editor.
<editor:SfDropDownColorPicker>
    <FlyoutBase.AttachedFlyout>
        <editor:DropDownFlyout>
            <editor:SfColorPicker
                ColorEditorsVisibilityMode="Collapsed"
                BrushTypeOptions="SolidColorBrush"/>
        </editor:DropDownFlyout>
    </FlyoutBase.AttachedFlyout>
</editor:SfDropDownColorPicker>Constructors
SfDropDownColorPicker()
Initializes a new instance of the SfDropDownColorPicker class.
Declaration
public SfDropDownColorPicker()Fields
CommandProperty
Identifies Command dependency property.
Declaration
public static readonly DependencyProperty CommandPropertyField Value
| Type | 
|---|
| Microsoft.UI.Xaml.DependencyProperty | 
SelectedBrushProperty
Identifies SelectedBrush dependency property.
Declaration
public static readonly DependencyProperty SelectedBrushPropertyField Value
| Type | 
|---|
| Microsoft.UI.Xaml.DependencyProperty | 
Properties
Command
Gets or sets the command to invoke when primary button is pressed or SelectedBrush is changed.
Declaration
public ICommand Command { get; set; }Property Value
| Type | 
|---|
| System.Windows.Input.ICommand | 
Remarks
Default value is null. In DropDown mode, this command is invoked only when SelectedBrush is changed. In Split mode, this command is invoked when SelectedBrush is changed and when primary button is clicked.
SelectedBrush
Gets or sets the value of SeletedBrush.
Declaration
public Brush SelectedBrush { get; set; }Property Value
| Type | 
|---|
| Microsoft.UI.Xaml.Media.Brush | 
Methods
Dispose(Boolean)
Release the unmanaged resources of SfDropDownBase.
Declaration
protected override void Dispose(bool disposing)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | disposing | Used to indicate perform dispose or not. | 
Overrides
OnAcceptButtonClicked()
Called when Accept button is clicked.
Declaration
protected override void OnAcceptButtonClicked()Overrides
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()Returns
| Type | 
|---|
| Microsoft.UI.Xaml.Automation.Peers.AutomationPeer | 
OnPrimaryButtonClicked()
Called when primary button is clicked.
Declaration
protected override void OnPrimaryButtonClicked()Overrides
OpenDropDown()
Called when opening the drop-down.
Declaration
protected override void OpenDropDown()Overrides
Events
SelectedBrushChanged
Occurs when value of selected brush has been changed.
Declaration
public event EventHandler<SelectedBrushChangedEventArgs> SelectedBrushChangedEvent Type
| Type | 
|---|
| System.EventHandler<SelectedBrushChangedEventArgs> |