Class SfDropDownBase
Represents a base class which is used to create a custom picker controls like SfDropDownColorPalette, SfDropDownColorPicker.
Inheritance
Namespace: Syncfusion.UI.Xaml.Editors
Assembly: Syncfusion.Editors.WinUI.dll
Syntax
public abstract class SfDropDownBase : Control
Constructors
SfDropDownBase()
Initializes a new instance of the SfDropDownBase class.
Declaration
public SfDropDownBase()
Fields
ContentProperty
Identifies Content dependency property.
Declaration
public static readonly DependencyProperty ContentProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
ContentTemplateProperty
Identifies ContentTemplate dependency property.
Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownButtonTemplateProperty
Identifies DropDownButtonTemplate dependency property.
Declaration
public static readonly DependencyProperty DropDownButtonTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownContentProperty
Identifies DropDownContent dependency property.
Declaration
public static readonly DependencyProperty DropDownContentProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownContentTemplateProperty
Identifies DropDownContentTemplate dependency property.
Declaration
public static readonly DependencyProperty DropDownContentTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownHeightProperty
Identifies DropDownHeight dependency property.
Declaration
public static readonly DependencyProperty DropDownHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownModeProperty
Identifies DropDownMode dependency property.
Declaration
public static readonly DependencyProperty DropDownModeProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
DropDownPlacementProperty
Identifies DropDownPlacement dependency property.
Declaration
public static readonly DependencyProperty DropDownPlacementProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
ShowDropDownButtonProperty
Identifies ShowDropDownButton dependency property.
Declaration
public static readonly DependencyProperty ShowDropDownButtonProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
ShowSubmitButtonsProperty
Identifies ShowSubmitButtons dependency property.
Declaration
public static readonly DependencyProperty ShowSubmitButtonsProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty |
Properties
Content
Gets or sets the content of the SfDropDownBase control.
Declaration
public object Content { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
ContentTemplate is used to customize the UI of Content.
ContentTemplate
Gets or sets the data template that is used to display the content of SfDropDownBase.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
Content is the DataContext ContentTemplate.
DropDownButtonTemplate
Gets or sets the template for the drop down button (aka secondary button) in SfDropDownBase control.
Declaration
public DataTemplate DropDownButtonTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
DataContext is null for this template.
DropDownContent
Gets or sets the content for the dropdown in SfDropDownBase control.
Declaration
public object DropDownContent { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
DropDownContentTemplate is used to customize the UI of DropDownContent.
DropDownContentTemplate
Gets or sets the data template for the dropdown content of the SfDropDownBase control.
Declaration
public DataTemplate DropDownContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
DropDownContent is the DataContext of DropDownContentTemplate.
DropDownHeight
Gets or sets the height of the drop down popup in SfDropDownBase control.
Declaration
public double DropDownHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is Auto. When DropDownHeight is auto, popup height changes based on size required by DropDownContentTemplate. |
DropDownMode
Gets or sets a value that indicates whether to display control as SplitButton or DropDown.
Declaration
public DropDownMode DropDownMode { get; set; }
Property Value
Type | Description |
---|---|
DropDownMode | The default value is DropDown. |
Remarks
In DropDown mode, control opens DropDownContent as a flyout. In Split mode, control represents a button with two parts that can be invoked separately. One part behaves like a standard button and the other part invokes a flyout.
DropDownPlacement
Gets or sets a value indicating the placement of drop-down, when it opens.
Declaration
public FlyoutPlacementMode DropDownPlacement { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.Primitives.FlyoutPlacementMode | The default value is Microsoft.UI.Xaml.Controls.Primitives.FlyoutPlacementMode.Bottom. |
ShowDropDownButton
Gets or sets a value indicating whether to show or hide the drop down button in SfDropDownBase control.
Declaration
public bool ShowDropDownButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. |
ShowSubmitButtons
Gets or sets a value indicating whether to show or hide the OK and Cancel button in SfDropDownBase control.
Declaration
public bool ShowSubmitButtons { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true. OK and Cancel button is shown below DropDownContent. OnAcceptButtonClicked() virtual method will be called, when OK button is clicked. OnDeclineButtonClicked() virtual method will be called, when Cancel button is clicked. |
Methods
CloseDropDown()
Called when closing the drop-down.
Declaration
protected virtual void CloseDropDown()
OnAcceptButtonClicked()
Called when OK button is clicked.
Declaration
protected virtual void OnAcceptButtonClicked()
OnApplyTemplate()
Declaration
protected override void OnApplyTemplate()
OnDeclineButtonClicked()
Called when cancel button is clicked.
Declaration
protected virtual void OnDeclineButtonClicked()
OnKeyDown(KeyRoutedEventArgs)
Declaration
protected override void OnKeyDown(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | e |
OnKeyUp(KeyRoutedEventArgs)
Declaration
protected override void OnKeyUp(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | e |
OnPrimaryButtonClicked()
Called when primary button is clicked.
Declaration
protected virtual void OnPrimaryButtonClicked()
OpenDropDown()
Called when opening the drop-down.
Declaration
protected virtual void OpenDropDown()
Events
DropDownClosed
Occurs when drop down is closed.
Declaration
public event EventHandler DropDownClosed
Event Type
Type | Description |
---|---|
System.EventHandler |
Remarks
Drop-down can be opened by clicking drop-down button, pressing Alt + Down key, F4 key. Drop-down will be closed when Esc key is pressed or when focus is lost.
DropDownOpened
Occurs when drop down is opened.
Declaration
public event EventHandler DropDownOpened
Event Type
Type | Description |
---|---|
System.EventHandler |
Remarks
Drop-down can be opened by clicking drop-down button, pressing Alt + Down key, F4 key. Drop-down will be closed when Esc key is pressed or when focus is lost.