Migrate from Xamarin.Forms SfCalendar to .NET MAUI SfCalendar
21 Aug 202414 minutes to read
To make the migration from the Xamarin SfCalendar to .NET MAUI SfCalendar easier, most of the APIs from the Xamarin SfCalendar were kept in the.NET MAUI SfCalendar. However, to maintain the consistency of API naming in the .NET MAUI SfCalendar, some of the APIs have been renamed. Please find the difference in the following topics.
Namespaces
Xamarin SfCalendar | .NET MAUI SfCalendar |
---|---|
Syncfusion.SfCalendar.XForms | Syncfusion.Maui.Calendar |
NOTE
The selection-based
.NET MAUI SfCalendar
does not manage appointments like theXamarin SfCalendar
does. If you require appointment/events management use.NET MAUI SfScheduler
.
Initialize control
To initialize the control, import the calendar namespace and initialize SfCalendar
as shown in the following code sample.
Xamarin SfCalendar | .NET MAUI SfCalendar |
---|---|
|
|
Classes
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Represents a class which holds the start and end date of the range in SfCalendar. | ||
Represents a class which is used to configure all the properties and styles of calendar month view. | ||
Represents a class which is used to used to configure all the properties and styles of calendar year, decade and century view. | ||
Represents a class which is used to hold the tap interaction event details and it occurs when the user clicks or touch on the calendar elements. | ||
Represents a class which is used to hold the long press interaction event details and it occurs when the user long press inside the calendar elements. | ||
Represents a class which is used to hold the view changed event details. | ||
Represents a class which is used to hold the selection changed event details. | ||
Represents a class which is used to hold the view changed event details. | ||
Nil | Use properties from . | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Use properties from | |
Nil | Use the event args. | |
Nil | Not Supported. | |
Nil | Use properties from | |
Nil | Use the event args. |
Properties
SfCalendar
The following code example, explains how to initialize the properties of the Xamarin SfCalendar
and .NET MAUI SfCalendar
class.
Xamarin SfCalendar | .NET MAUI SfCalendar |
---|---|
|
|
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Nil | For agenda view related support use the .NET MAUI Scheduler control. | |
Gets or sets the function to decide whether the cell is selectable or not in the calendar. | ||
Nil | Use the for this requirement. | |
Nil | By using custom header (hides default view header using value as 0), you can customize. | |
Nil | For related support suggesting to use .NET MAUI Scheduler | |
Gets or sets the display date to programmatically navigate the dates in the SfCalendar. | ||
Gets or sets a value indicating whether the dates enabled or disabled before today date. | ||
Gets or sets a value indicating whether the swiping selection enabled for select the date range. | ||
[FirstDayOfWeek(From MonthView)] |
Gets or sets the day of week that used to change the default first day of week in SfCalendar. | |
[Height(From HeaderView)] |
Gets or sets the value to specify the height of header view on SfCalendar. | |
Represents a class which is used to customize all the properties of header view of the SfCalendar. | ||
Gets or sets a command to hold a date of SfCalendar. | ||
Nil | Not Supported. | |
Nil | Refer to this [link](https://help.syncfusion.com/maui/calendar/localization) for using localization in .NET MAUI Calendar | |
Gets or sets the maximum display date to restrict the visible dates in the SfCalendar. | ||
Nil | For related support suggesting to use .NET MAUI Scheduler | |
Gets or sets the minimum display date to restrict the visible dates in the SfCalendar. | ||
Gets or sets a command to change the view of SfCalendar. | ||
Gets or sets the properties which allows to customize the calendar month view. | ||
Gets or sets the display date to programmatically navigate the dates in the SfCalendar. | ||
Nil | It can be achieved by setting the property inside the event. | |
Nil | By using custom header ( value as 0), customize the navigation arrows. | |
Nil | By using custom header, customize the navigation arrows. | |
Nil | By using custom header, customize the navigation arrows. | |
Gets or sets a value which determines the direction of the calendar scrolls. | ||
Gets or sets the selected date to select the particular date of the calendar. | ||
[NumberOfVisibleWeeks(From MonthView)] |
Gets or sets a value to display the number of weeks in calendar month view. | |
Gets or sets the selected date to select the particular date of the calendar. | ||
Gets or sets the selected dates to select the multiple dates of the calendar. | ||
Gets or sets the selected date range to select the range of dates of the calendar. | ||
Gets or sets a command to select a date of SfCalendar. | ||
Gets or sets the selection mode of the calendar. | ||
Nil | By using value as 0 in the HeaderView, you can hide and show the headers. | |
Nil | Not Supported. | |
Gets or sets a value indicating whether to displays the leading and trailing dates in the month, decade, century views of the SfCalendar. | ||
[ShowNavigationArrows(From HeaderView)] |
Gets or sets a value indicating whether to displays the navigation arrows on the header view of the SfCalendar. | |
Gets or sets a value indicating whether the navigation enabled on year, decade and century cell interaction. | ||
Gets or sets a command to tap a date of SfCalendar. | ||
Gets or sets a value indicating whether the selected date is deselect through interaction on single selection mode of SfCalendar. | ||
Nil | Not Supported. | |
Gets or sets the built-in views such as month, year, decade and century of the SfCalendar. | ||
Nil | Use visible dates from the event. | |
Nil | Not Supported. | |
Gets or sets the properties which allows to customize the calendar year, decade and century views. |
MonthViewSettings
The following code example explains how to configure the month view settings in Xamarin SfCalendar
and .NET MAUI SfCalendar
.
Xamarin SfCalendar | .NET MAUI SfCalendar |
---|---|
|
|
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Nil | Not Supported. | |
Gets or sets the text style of the disabled month cells text, that used to customize the text color, font, font size, font family and font attributes. | ||
Nil | Using the , you can customize the month cells. | |
Nil | Using the , you can customize the month cells. | |
Gets or sets the month cell template or template selector. | ||
Gets or sets the background for the month cells of the calendar month view. | ||
Gets or sets the text color of the text style. | ||
Gets or sets the value that describes the highlight of selection based on selection mode of the calendar. | ||
Nil | Using the , you can align the month cells text. | |
Nil | Not Supported. | |
[FontFamily(From TextStyle, TodayTextStyle, TrailingLeadingDatesTextStyle, DisabledDatesTextStyle, WeekendDatesTextStyle, SpecialDatesTextStyle of MonthView)] |
Gets or sets the font family of the text style. | |
[FontSize(From TextStyle, TodayTextStyle, TrailingLeadingDatesTextStyle, DisabledDatesTextStyle, WeekendDatesTextStyle, SpecialDatesTextStyle of MonthView)] |
Gets or sets the font size of the text style. | |
[FontAttributes(From TextStyle, TodayTextStyle, TrailingLeadingDatesTextStyle, DisabledDatesTextStyle, WeekendDatesTextStyle, SpecialDatesTextStyle of MonthView)] |
Gets or sets the font attributes of the text style. | |
[Background(From HeaderView of MonthView)] |
Gets or sets the background of the view header view in SfCalendar. | |
Nil | Not Supported. | |
[FontAttributes(From TextStyle of HeaderView in MonthView)] |
Gets or sets the font attributes of the text style. | |
Gets or sets the font family of the text style. | ||
[FontSize(From TextStyle of HeaderView in MonthView)] |
Gets or sets the font size of the text style. | |
[TextColor(From TextStyle of HeaderView in MonthView)] |
Gets or sets the text color of the text style. | |
[TextFormat(From HeaderView of MonthView)] |
Gets or sets the font attributes of the text style. | |
[Height(From HeaderView of MonthView)] |
Gets or sets the value to specify the height of view header view on SfCalendar. | |
Nil | Using the , you can customize the month cells. | |
Gets or sets the background for the disabled month cells of the calendar month view. | ||
[TextColor(From DisabledDatesTextStyle of MonthView)] |
Gets or sets the text color of the text style. | |
[Background(From HeaderView of SfCalendar)] |
Gets or sets the background of the header view in SfCalendar. | |
Nil | Not Supported. | |
[FontAttributes(From TextStyle of HeaderView in SfCalendar)] |
Gets or sets the font attributes of the text style. | |
[FontFamily(From TextStyle of HeaderView in SfCalendar)] |
Gets or sets the font family of the text style. | |
[FontSize(From TextStyle of HeaderView in SfCalendar)] |
Gets or sets the font size of the text style. | |
[TextColor(From TextStyle of HeaderView in SfCalendar)] |
Gets or sets the text color of the text style. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Use properties from . | |
Gets or sets the background for the trailing and leading month cells of the calendar month view. | ||
Gets or sets the text color of the text style. | ||
[TextColor(From SelectionTextStyle and RangeTextStyle)] |
Gets or sets the text color of the text style. | |
Nil | Not Supported. | |
[SelectionShape(From SfCalendar)] |
Gets or sets the selection shape of the SfCalendar. | |
[TodayHighlightBrush(From SfCalendar)] |
Gets or sets the value that describes the today highlight color value. | |
[SelectionBackground(From SfCalendar)] |
Gets or sets the value that describes the highlight of selection based on selection mode of the calendar. | |
[TextColor(From SelectionTextStyle and RangeTextStyle)] |
Gets or sets the text color of the text style. | |
TextColor(From TodayTextStyle)] |
Gets or sets the text color of the text style. | |
Background, TodayBackground, TrailingLeadingDatesBackground, DisabledDatesBackground, SpecialDatesBackground |
Gets or sets the background for the week day month cells of the calendar month view. | |
[TextColor(From TextStyle, TodayTextStyle, TrailingLeadingDatesTextStyle, DisabledDatesTextStyle, SpecialDatesTextStyle)] |
Gets or sets the text color of the text style. | |
Gets or sets the background for the weekend month cells of the calendar month view. | ||
[TextColor(From WeekendDatesTextStyle)] |
Gets or sets the text color of the text style. |
YearViewSettings
The following code example explains how to configure the year view settings in Xamarin SfCalendar
and .NET MAUI SfCalendar
.
Xamarin SfCalendar | .NET MAUI SfCalendar |
---|---|
|
|
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Gets or sets the background for the month cells of the calendar month view. | ||
Nil | Use the property from YearView. | |
Nil | Use the property from YearView. | |
Nil | Use the property from YearView. | |
[TextColor(From TextStyle, TodayTextStyle, LeadingDatesTextStyle, DisabledDatesTextStyle)] |
Gets or sets the text color of the text style. | |
[Background(From HeaderView of SfCalendar)] |
Gets or sets the background of the header view in SfCalendar. | |
Gets or sets the background for the year, decade and century cells of the calendar year, decade and century view. | ||
[TextStyle(From HeaderView of SfCalendar)] |
Gets or sets the text style of the header text in SfCalendar. |
Enums
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Nil | Use the property. | |
Nil | Using the , you can customize the month cells. | |
Nil | Using the , you can align the month cells text. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Defines the navigation direction for the SfCalendar. | ||
Defines the selection mode for the SfCalendar. | ||
Defines the selection shape for the SfCalendar. | ||
Nil | Not Supported. | |
Defines the view for the SfCalendar. | ||
Nil | Not Supported. |
Events
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Nil | Not Supported. | |
Nil | Not Supported. | |
Occurs whenever the calendar view and visible dates changed on SfCalendar. | ||
Nil | Not Supported. | |
Occurs after the tap interaction on SfCalendar. | ||
Occurs after the long press interaction on SfCalendar. | ||
Nil | Customize the header view by using the properties of . | |
Nil | Not Supported. | |
Nil | Customize the header view by using the properties of . | |
Occurs whenever the calendar view and visible dates changed on SfCalendar. | ||
Nil | Customize the year view by using the properties of . | |
Occurs after the selection changed on SfCalendar. |
Methods
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Gets or sets a value indicating whether the dates are enabled or disabled before today's date. | ||
Move to previous view which displays previous view dates. | ||
Nil | You can deselect the date by using the CanToggleDaySelection property. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Move to next view which displays next view dates. | ||
Nil | Using , you can navigate to specific date. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. |