Class PickerBase
Class that represents and render the picker control,
Implements
Inherited Members
Namespace: Syncfusion.Maui.Picker
Assembly: Syncfusion.Maui.Picker.dll
Syntax
public abstract class PickerBase : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IPicker, IPickerView, IColumnHeaderView, IFooterView, IHeaderView, IPickerCommon
Constructors
PickerBase()
Declaration
protected PickerBase()
Fields
AcceptCommandProperty
Identifies the AcceptCommand dependency property.
Declaration
public static readonly BindableProperty AcceptCommandProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for AcceptCommand dependency property. |
ColumnDividerColorProperty
Identifies the ColumnDividerColor dependency property.
Declaration
public static readonly BindableProperty ColumnDividerColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ColumnDividerColor dependency property. |
ColumnHeaderTemplateProperty
Identifies the ColumnHeaderTemplate dependency property.
Declaration
public static readonly BindableProperty ColumnHeaderTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ColumnHeaderTemplate dependency property. |
DeclineCommandProperty
Identifies the DeclineCommand dependency property.
Declaration
public static readonly BindableProperty DeclineCommandProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DeclineCommand dependency property. |
EnableLoopingProperty
Identifies the EnableLoopingProperty dependency property.
Declaration
public static readonly BindableProperty EnableLoopingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for EnableLoopingProperty dependency property. |
FooterTemplateProperty
Identifies the FooterTemplate dependency property.
Declaration
public static readonly BindableProperty FooterTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for FooterTemplate dependency property. |
FooterViewProperty
Identifies the FooterView dependency property.
Declaration
public static readonly BindableProperty FooterViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for FooterView dependency property. |
HeaderTemplateProperty
Identifies the HeaderTemplate dependency property.
Declaration
public static readonly BindableProperty HeaderTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for HeaderTemplate dependency property. |
IsOpenProperty
Identifies the IsOpen dependency property.
Declaration
public static readonly BindableProperty IsOpenProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IsOpen dependency property. |
ItemHeightProperty
Identifies the ItemHeight dependency property.
Declaration
public static readonly BindableProperty ItemHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ItemHeight dependency property. |
ModeProperty
Identifies the Mode dependency property.
Declaration
public static readonly BindableProperty ModeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Mode dependency property. |
PopupHeightProperty
Identifies the PopupHeightProperty dependency property.
Declaration
public static readonly BindableProperty PopupHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for PopupHeightProperty dependency property. |
PopupWidthProperty
Identifies the PopupWidthProperty dependency property.
Declaration
public static readonly BindableProperty PopupWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for PopupWidthProperty dependency property. |
RelativePositionProperty
Identifies the RelativePosition dependency property.
Declaration
public static readonly BindableProperty RelativePositionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for RelativePosition dependency property. |
RelativeViewProperty
Identifies the RelativeView dependency property.
Declaration
public static readonly BindableProperty RelativeViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for RelativeView dependency property. |
SelectedTextStyleProperty
Identifies the SelectedTextStyle dependency property.
Declaration
public static readonly BindableProperty SelectedTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SelectedTextStyle dependency property. |
SelectionViewProperty
Identifies the SelectionView dependency property.
Declaration
public static readonly BindableProperty SelectionViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SelectionView dependency property. |
TextDisplayModeProperty
Identifies the TextDisplayMode dependency property.
Declaration
public static readonly BindableProperty TextDisplayModeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TextDisplayMode dependency property. |
TextStyleProperty
Identifies the TextStyle dependency property.
Declaration
public static readonly BindableProperty TextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TextStyle dependency property. |
Properties
AcceptCommand
Gets or sets the picker ok button clicked command.
Declaration
public ICommand AcceptCommand { get; set; }
Property Value
Type |
---|
System.Windows.Input.ICommand |
ColumnDividerColor
Gets or sets the value of column divider color in SfPicker. This property can be used to customize the column divider color in Picker.
Declaration
public Color ColumnDividerColor { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Graphics.Color |
ColumnHeaderTemplate
Gets or sets the column header template or template selector for picker column header.
Declaration
public DataTemplate ColumnHeaderTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
The BindingContext of the ColumnHeaderTemplate is respective picker control. When using column header template, the column header style customization will not be applicable.
DeclineCommand
Gets or sets the picker cancel button clicked command.
Declaration
public ICommand DeclineCommand { get; set; }
Property Value
Type |
---|
System.Windows.Input.ICommand |
EnableLooping
Gets or sets a value indicating whether the picker can perform looping.
Declaration
public bool EnableLooping { get; set; }
Property Value
Type |
---|
System.Boolean |
FooterTemplate
Gets or sets the footer template or template selector for picker footer.
Declaration
public DataTemplate FooterTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
The BindingContext of the FooterTemplate is respective picker control. When using footer template, the footer style customization will not be applicable.
FooterView
Gets or sets the value of footer view. This property can be used to customize the Footer in Picker.
Declaration
public PickerFooterView FooterView { get; set; }
Property Value
Type |
---|
PickerFooterView |
HeaderTemplate
Gets or sets the header template or template selector for picker header
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
Remarks
The BindingContext of the HeaderTemplate is respective picker control. When using header template, the header style customization will not be applicable.
IsOpen
Gets or sets a value indicating whether the picker is open or not.
Declaration
public bool IsOpen { get; set; }
Property Value
Type |
---|
System.Boolean |
ItemHeight
Gets or sets the value to specify the item height of picker view on Picker.
Declaration
public double ItemHeight { get; set; }
Property Value
Type |
---|
System.Double |
Mode
Gets or sets the mode of the picker.
Declaration
public PickerMode Mode { get; set; }
Property Value
Type |
---|
PickerMode |
PopupHeight
Gets or sets the height of the popup in the picker.
Declaration
public double PopupHeight { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
The default height of the popup will be the addition of header height, column header height, picker items' five items height, and footer height.
PopupWidth
Gets or sets the width of the popup in the picker.
Declaration
public double PopupWidth { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
The default width of the popup will be the addition of picker column width.
RelativePosition
Gets or sets the relative position of the picker popup.
Declaration
public PickerRelativePosition RelativePosition { get; set; }
Property Value
Type |
---|
PickerRelativePosition |
RelativeView
Gets or sets the view relative to which the picker dialog should be displayed based on the RelativePosition. RelativePosition
Declaration
public View RelativeView { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.View |
Remarks
It is only applicable for RelativeDialog mode. If no relative view is given, the picker base will be set as the relative view.
SelectedTextStyle
Gets or sets the picker selected text style in Picker.
Declaration
public PickerTextStyle SelectedTextStyle { get; set; }
Property Value
Type |
---|
PickerTextStyle |
SelectionView
Gets or sets the value of selection view. This property can be used to customize the selection in Picker.
Declaration
public PickerSelectionView SelectionView { get; set; }
Property Value
Type |
---|
PickerSelectionView |
TextDisplayMode
Gets or sets the text display mode of the picker.
Declaration
public PickerTextDisplayMode TextDisplayMode { get; set; }
Property Value
Type |
---|
PickerTextDisplayMode |
TextStyle
Gets or sets the picker item text style in Picker.
Declaration
public PickerTextStyle TextStyle { get; set; }
Property Value
Type |
---|
PickerTextStyle |
Methods
ArrangeContent(Rect)
Method used to arrange the children with in the bounds.
Declaration
protected override Size ArrangeContent(Rect bounds)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.Rect | bounds | The size of the layout. |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | Returns layout size. |
Overrides
Initialize()
Method to wire the events.
Declaration
protected virtual void Initialize()
MeasureContent(Double, Double)
Method used to measure the children based on width and height value.
Declaration
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | The maximum width request of the layout. |
System.Double | heightConstraint | The maximum height request of the layout. |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | Returns maximum size of the layout. |
Overrides
OnCancelButtonClicked(EventArgs)
Triggers when the cancel button clicked.
Declaration
protected virtual void OnCancelButtonClicked(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event arguments. |
OnHeaderButtonClicked(Int32)
Triggers while the header button clicked.
Declaration
protected virtual void OnHeaderButtonClicked(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the header button. |
OnOkButtonClicked(EventArgs)
Triggers when the ok button clicked.
Declaration
protected virtual void OnOkButtonClicked(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event arguments. |
OnPickerLoading()
Triggers while the popup opening or switched from popup to default.
Declaration
protected virtual void OnPickerLoading()
OnPopupClosed(EventArgs)
Triggers when the picker popup closed.
Declaration
protected virtual void OnPopupClosed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event arguments. |
OnPopupClosing(CancelEventArgs)
Triggers when the picker popup closing.
Declaration
protected virtual void OnPopupClosing(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | e | The event arguments. |
OnPopupOpened(EventArgs)
Triggers when the picker popup opened.
Declaration
protected virtual void OnPopupOpened(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event arguments. |
OnPropertyChanged(String)
Method triggers when the time picker property changed
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The property name. |
Events
CancelButtonClicked
Occurs after the cancel button clicked on SfPicker. This event is not applicable for while the footer view is not visible.
Declaration
public event EventHandler CancelButtonClicked
Event Type
Type |
---|
System.EventHandler |
Closed
Occurs when the picker popup is closed.
Declaration
public event EventHandler Closed
Event Type
Type |
---|
System.EventHandler |
Closing
Occurs when the picker popup is closing.
Declaration
public event EventHandler<CancelEventArgs> Closing
Event Type
Type |
---|
System.EventHandler<System.ComponentModel.CancelEventArgs> |
OkButtonClicked
Occurs after the ok button clicked on SfPicker. This event is not applicable for while the footer view is not visible and the ok button is not visible.
Declaration
public event EventHandler OkButtonClicked
Event Type
Type |
---|
System.EventHandler |
Opened
Occurs after the picker popup is opened.
Declaration
public event EventHandler Opened
Event Type
Type |
---|
System.EventHandler |