How to Customize Selection with Style in the .NET MAUI Calendar?
In the Syncfusion® .NET MAUI Calendar control, you can customize the appearance of selected dates using the SelectionBackground property of the SfCalendar to change the background color of the selected date.
You can change the style of the selected date’s text using the properties TextColor, FontSize, FontAttributes, and FontFamily belonging to the CalendarTextStyle of SelectionTextStyle. The following code sample demonstrates how to use these properties.
To customize the style of the selected date’s text in the .NET MAUI Calendar (SfCalendar), you can use the properties TextColor, FontSize, FontAttributes, and FontFamily available in the CalendarTextStyle of the SelectionTextStyle.
XAML
<calendar:SfCalendar x:Name="calendar" SelectionBackground="Red"> <calendar:SfCalendar.MonthView> <calendar:CalendarMonthView> <calendar:CalendarMonthView.SelectionTextStyle> <calendar:CalendarTextStyle TextColor="#FFFFFF" FontAttributes="Bold,Italic" FontSize="20" /> </calendar:CalendarMonthView.SelectionTextStyle> </calendar:CalendarMonthView> </calendar:SfCalendar.MonthView> </calendar:SfCalendar>
Download the complete sample on GitHub
Output
Conclusion
I hope you enjoyed learning how to customize the selection using style in the .NET MAUI Calendar (SfCalendar).
You can refer to our .NET MAUI Calendar’s feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Calendar documentation to understand how to present and manipulate data.
For current customers, you can check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Calendar and other .NET MAUI components.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!