Migrate from Xamarin.Forms SfDatePicker to .NET MAUI SfDatePicker
21 Aug 20246 minutes to read
To make the migration from the Xamarin SfDatePicker to .NET MAUI SfDatePicker easier, most of the APIs from the Xamarin SfDatePicker are kept in the .NET MAUI SfDatePicker. However, to maintain the consistency of API naming in the .NET MAUI SfDatePicker, some of the APIs have been renamed. Please find the difference in the following topics.
Namespaces
Xamarin SfDatePicker | .NET MAUI SfDatePicker |
---|---|
Syncfusion.XForms.Pickers | Syncfusion.Maui.Picker |
Initialize control
To initialize the control, import the date picker namespace and initialize SfDatePicker
as shown in the following code sample.
Xamarin SfDatePicker | .NET MAUI SfDatePicker |
---|---|
|
|
Classes
Xamarin SfDatePicker | .NET MAUI SfDatePicker | Description |
---|---|---|
Represents a base used to achieve the date picker custom view. | ||
Represents a class which is used to hold the selection changed event details. |
Properties
SfDatePicker
The following code example, explains how to initialize the properties of the Xamarin SfDatePicker
and .NET MAUI SfDatePicker
class.
Xamarin SfDatePicker | .NET MAUI SfDatePicker |
---|---|
|
|
Xamarin SfDatePicker | .NET MAUI SfDatePicker | Description |
---|---|---|
Nil | Not Supported. | |
Gets or sets a command to decline a selected date of SfDatePicker. | ||
Gets or sets the selected date to select the particular date of the date picker. | ||
Gets or sets the day header text to change the day column header. | ||
Gets or sets the day interval to restrict the visible days. | ||
Gets or set the format that is used to change the format of SfDatePicker. | ||
Gets or sets the maximum date to restrict the visible dates in the SfDatePicker. | ||
Gets or sets the minimum date to restrict the visible dates in the SfDatePicker. | ||
Gets or sets the month header text to change the month column header. | ||
Gets or sets the month interval to restrict the visible months. | ||
Gets or sets a command to accept a selected date of SfDatePicker. | ||
Gets or sets the year interval to restrict the visible years. | ||
Gets or sets the year header text to change the year column header. |
PickerBase
Xamarin SfDatePicker | .NET MAUI SfDatePicker | Description |
---|---|---|
Nil | Not Supported. | |
Nil | Not Supported. | |
Gets or sets the background color of the footer. | ||
TextColor(From TextStyle of PickerFooterView) |
Gets or sets the text color of the text style. | |
Gets or sets the background color of the column header. | ||
FontAttributes(From TextStyle of DatePickerColumnHeaderView) |
Gets or sets the font attribute of the column header text style. | |
Gets or sets the font family of the column header text style. | ||
FontSize(From TextStyle of DatePickerColumnHeaderView) |
Gets or sets the font size of the column header text style. | |
Gets or sets the height of the column header. | ||
TextColor(From TextStyle of DatePickerColumnHeaderView) |
Gets or sets the text color of the column header text style. | |
Nil | Not Supported. | |
Height(From PickerFooterView) |
Gets or sets the height of the footer view. | |
Gets or sets the value of footer view. This property can be used to customize the Footer in DatePicker. | ||
Gets or sets the background color of the header. | ||
FontAttribute(From TextStyle of PickerHeaderView) |
Gets or sets the font attribute of the header text style. | |
FontFamily(From TextStyle of PickerHeaderView) |
Gets or sets the font family of the header text style. | |
FontSize(From TextStyle of PickerHeaderView) |
Gets or sets the font size of the header text style. | |
Height(From PickerHeaderView) |
Gets or sets the height of the header. | |
TextColor(From TextStyle of PickerHeaderView) |
Gets or sets the text color of the header text style. | |
Gets or sets the value of header view. This property can be used to customize the header in DatePicker. | ||
Gets or sets the open to allow the dialog mode. | ||
Gets or sets the item height of each item source. | ||
Gets or sets the background color of the footer. | ||
TextColor(From TextStyle of PickerFooterView) |
Gets or sets the text color of the text style. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Gets or sets the background color of the selected item. | ||
FontAttributes(From SelectedTextStyle of PickerBase) |
Gets or sets the font attribute of the selected text style. | |
FontFamily(From SelectedTextStyle of PickerBase) |
Gets or sets the font family of the selected text style. | |
FontSize(From SelectedTextStyle of PickerBase) |
Gets or sets the font size of the selected text style. | |
TextColor(From SelectedTextStyle of PickerBase) |
Gets or sets the text color of the selected text style. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
FontAttributes(From TextStyle of PickerBase) |
Gets or sets the font attributes of the unselected text style.. | |
FontFamily(From TextStyle of PickerBase) |
Gets or sets the font family of the unselected text style.. | |
FontSize(From TextStyle of PickerBase) |
Gets or sets the font size of the unselected text style.. | |
TextColor(From TextStyle of PickerBase) |
Gets or sets the text color of the unselected text style.. |
Enums
Xamarin SfDatePicker | .NET MAUI SfDatePicker | Description |
---|---|---|
Defines the date format for the date picker. | ||
Defines the mode of the date picker. |
Events
Xamarin SfDatePicker | .NET MAUI SfDatePicker | Description |
---|---|---|
Occurs whenever opened on the date picker. | ||
Occurs whenever closed on the date picker. | ||
Occurs whenever closing on the date picker. | ||
Occurs whenever selection changed on the the date picker. | ||
Occurs whenever footer ok button is clicked in the date picker. | ||
Occurs whenever footer cancel button is clicked in the date picker. |
Upcoming Features
- Enable looping support.