Hi Frank,
Thank you for the update.
Your requirement of “Customizing the Month cell background color based on the dates” in Calendar Xamarin.Forms can be achieved using OnMonthCellLoaded event. Using this event, you can customize Text, Backgroud, Border color and Font by using MonthCellLoadedEventArgs argument. Earlier We have suggested SfSchedule control, since you have mentioned as WorkWeekView.
Please refer the following code for your reference,
[C#] calendar.OnMonthCellLoaded += Calendar_OnMonthCellLoaded;
…
private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs args)
{
if (args.Date.Date == appointment.StartTime.Date)
{
args.BackgroundColor = Color.blue;
}
}
|
We have prepared sample based on your requirement,
In the sample, we have set month cell Background color as LightSkyBlue for the appointment available days and set LightGreen for the some of the dates in the cells. We have set with random days, you can set by considering your week end days based on your requirement by comparing to the date of MonthCellLoadedEventArgs argument.
We hope this helps. Please let us know if you have any query.
Regards,
Subburaj Pandian V