menu

Class SfDropDownColorPicker - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    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.

    Inheritance
    System.Object
    SfDropDownBase
    SfDropDownColorPicker
    Implements
    System.IDisposable
    Inherited Members
    SfDropDownBase.CloseDropDown()
    SfDropDownBase.Content
    SfDropDownBase.ContentProperty
    SfDropDownBase.ContentTemplate
    SfDropDownBase.ContentTemplateProperty
    SfDropDownBase.Dispose()
    SfDropDownBase.DropDownButtonTemplate
    SfDropDownBase.DropDownButtonTemplateProperty
    SfDropDownBase.DropDownClosed
    SfDropDownBase.DropDownHeight
    SfDropDownBase.DropDownHeightProperty
    SfDropDownBase.DropDownMode
    SfDropDownBase.DropDownModeProperty
    SfDropDownBase.DropDownOpened
    SfDropDownBase.DropDownPlacement
    SfDropDownBase.DropDownPlacementProperty
    SfDropDownBase.IsOpen
    SfDropDownBase.IsOpenProperty
    SfDropDownBase.OnApplyTemplate()
    SfDropDownBase.OnDeclineButtonClicked()
    SfDropDownBase.OnKeyDown(KeyRoutedEventArgs)
    SfDropDownBase.OnKeyUp(KeyRoutedEventArgs)
    SfDropDownBase.ShowDropDownButton
    SfDropDownBase.ShowDropDownButtonProperty
    SfDropDownBase.ShowSubmitButtons
    SfDropDownBase.ShowSubmitButtonsProperty
    Namespace: Syncfusion.UI.Xaml.Editors
    Assembly: Syncfusion.Editors.WinUI.dll
    Syntax
    public class SfDropDownColorPicker : SfDropDownBase, IDisposable
    Examples
    <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 CommandProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    SelectedBrushProperty

    Identifies SelectedBrush dependency property.

    Declaration
    public static readonly DependencyProperty SelectedBrushProperty
    Field 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
    SfDropDownBase.Dispose(Boolean)

    OnAcceptButtonClicked()

    Called when Accept button is clicked.

    Declaration
    protected override void OnAcceptButtonClicked()
    Overrides
    SfDropDownBase.OnAcceptButtonClicked()

    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
    SfDropDownBase.OnPrimaryButtonClicked()

    OpenDropDown()

    Called when opening the drop-down.

    Declaration
    protected override void OpenDropDown()
    Overrides
    SfDropDownBase.OpenDropDown()

    Events

    SelectedBrushChanged

    Occurs when value of selected brush has been changed.

    Declaration
    public event EventHandler<SelectedBrushChangedEventArgs> SelectedBrushChanged
    Event Type
    Type
    System.EventHandler<SelectedBrushChangedEventArgs>

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved