Migrate from Xamarin.Forms SfPicker to .NET MAUI SfPicker
21 Aug 20246 minutes to read
To make the migration from the Xamarin SfPicker to .NET MAUI SfPicker easier, most of the APIs from the Xamarin SfPicker were kept in the .NET MAUI SfPicker. However, to maintain the consistency of API naming in the .NET MAUI SfPicker, some of the APIs have been renamed. Please find the difference in the following topics.
Namespaces
Xamarin SfPicker | .NET MAUI SfPicker |
---|---|
Syncfusion.XForms.Pickers | Syncfusion.Maui.Picker |
Initialize control
To initialize the control, import the picker namespace and initialize SfPicker
as shown in the following code sample.
Xamarin SfPicker | .NET MAUI SfPicker |
---|---|
|
|
Classes
Xamarin SfPicker | .NET MAUI SfPicker | Description |
---|---|---|
The SfPicker class that represents a control, that allows you pick an item among a list of items. | ||
Represents a class which is used to hold the selection changed event details. |
Properties
SfPicker
The following code example, explains how to initialize the properties of the Xamarin SfPicker
and .NET MAUI SfPicker
class.
Xamarin SfPicker | .NET MAUI SfPicker |
---|---|
|
|
Xamarin SfPicker | .NET MAUI SfPicker | Description |
---|---|---|
Nil | Not Supported. | |
Nil | Not Supported. | |
Gets or sets the background of the footer view in SfPicker. | ||
TextColor From TextStyle of PickerFooterView |
Gets or sets the text color of the text style. | |
Gets or sets the background of the column header view in SfPicker. | ||
Gets or sets the font attribute of the text style. | ||
Gets or sets the font family of the text style. | ||
FontSize From TextStyle of PickerColumnHeaderView |
Gets or sets the font size of the text style. | |
Gets or sets the value to specify the height of column header view on SfPicker. | ||
Gets or sets the text color of the text style. | ||
TextColor From TextStyle of PickerColumnHeaderView |
Gets or sets the text color of the text style. | |
Gets or sets the value to specify the path value for items source. | ||
Nil | Not Supported. | |
Height From PickerBase of FooterView |
Gets or sets the value to specify the height of footer view on SfPicker. | |
FooterView From PickerBase |
Gets or sets the value of footer view. This property can be used to customize the of Footer in Picker. | |
Background From HeaderView |
Gets or sets the background of the header view in picker. | |
FontAttribute From TextStyle of PickerHeaderView |
Gets or sets the font attribute of the text style. | |
FontFamily From TextStyle of PickerHeaderView |
Gets or sets the font family of the text style. | |
FontSize From TextStyle of PickerHeaderView |
Gets or sets the font size of the text style. | |
Gets or sets the value to specify the height of header view on picker. | ||
Gets or sets the value to specify the header text of the columns on SfPicker. | ||
TextColor From TextStyle of PickerHeaderView |
Gets or sets the text color of the text style. | |
Gets or sets the value of header view. This property can be used to customize the of header in SfPicker. | ||
Gets or sets a value indicating whether the picker is open or not. | ||
Gets or sets the value to specify the height of picker view on Picker. | ||
Gets or sets the value to specify the text of columns on SfPicker. | ||
Gets or sets the picker item template in SfPicker. | ||
Background of PickerBase From PickerFooterView |
Gets or sets the background of the footer view in SfPicker. | |
TextColor From PickerTextStyle of TextStyle of PickerBase From PickerFooterView |
Gets or sets the text color of the ok button of footer view in SfPicker. | |
Nil | Not supported. | |
Nil | Not Supported. | |
Gets or sets the mode of the picker. | ||
Width From PickerColumn |
Gets or sets the width of the column. | |
Gets or sets the selected index of the columns on SfPicker. | ||
SelectedItem From PickerColumn |
Gets or sets the selected item of the columns on SfPicker. | |
Gets or sets the font attribute of the text style. | ||
Gets or sets the font family of the text style. | ||
Gets or sets the font size of the text style. | ||
Gets or sets the text color of the text style. | ||
Gets or sets the background color of the selected item. | ||
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
FontAttributes From TextStyle |
Gets or sets the font attribute of the text style. | |
FontFamily From TextStyle |
Gets or sets the font family of the text style. | |
Gets or sets the font size of the text style. | ||
Gets or sets the text color of the text style. | ||
Nil | Not Supported. | |
Gets or sets a command to accept a selected value of SfPicker. | ||
Gets or sets a command to decline a selected value of SfPicker. |
Events
Xamarin SfPicker | .NET MAUI SfPicker | Description |
---|---|---|
Occurs after the selected index changed on SfPicker. | ||
Occurs whenever the opened on Picker. | ||
Occurs whenever the closed on Picker. | ||
Occurs whenever the closing on Picker. | ||
Occurs whenever the footer ok button is clicked in Picker. | ||
Occurs whenever the footer cancel button is clicked in Picker. |
Known issues
- Picker background color is not applied to the popup.
- Picker dynamic items source does not render the picker item.
Upcoming features
- Looping support for picker items.