Migrate from Xamarin.Forms SfCalendar to .NET MAUI SfCalendar
19 Jan 202312 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.SfCalendar |
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 | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. |
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 | Not Supported. | |
Gets or sets the function to decide whether the cell is selectable or not in the calendar. | ||
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
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. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Gets or sets the maximum display date to restrict the visible dates in the SfCalendar. | ||
Nil | Not Supported. | |
Gets or sets the minimum display date to restrict the visible dates in the SfCalendar. | ||
Nil | Not Supported. | |
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 | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
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. | ||
Nil | Not Supported. | |
Gets or sets the selection mode of the calendar. | ||
Nil | Not Supported. | |
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. | ||
Nil | Not Supported. | |
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 | Not Supported. | |
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 | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
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 | Not Supported. | |
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 | Not Supported. | |
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 | Not Supported. | |
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(https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.CalendarTextStyle.html#Syncfusion_Maui_Calendar_CalendarTextStyle_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 |
---|---|---|
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
[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 | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
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 | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Occurs whenever the calendar view and visible dates changed on SfCalendar. | ||
Nil | Not Supported. | |
Occurs after the selection changed on SfCalendar. |
Methods
Xamarin SfCalendar | .NET MAUI SfCalendar | Description |
---|---|---|
Nil | Not Supported. | |
Move to previous view which displays previous view dates. | ||
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Move to next view which displays next view dates. | ||
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. | |
Nil | Not Supported. |
Upcoming Features
- Cell template support for month, year, decade and century views.
- Multi range selection support.