Skip to content Skip to sidebar Skip to footer

Adding Decorations Using Materialcalendarview Binding Library In Xamarin.android

I'm using the MaterialCalendarView library in my Xamarin.Android application, which works well for the most part except that I am unable add a span decoration to the calendar. Doc

Solution 1:

I am unable add a span decoration to the calendar.

The problem is that your ShouldDecorate always return false when you use dates.Contains(day) or dates.Exists(e => (e == day)).

It will compare HashCode firet so it will always return false, modify your code like below can solve this problem :

if (dates[0].ToString() == day.ToString() || dates[1].ToString() == day.ToString() || dates[2].ToString() == day.ToString() || dates[3].ToString() == day.ToString())
{
      returntrue;
}
else
{
       returnfalse;
}

Effect like this :

enter image description here

Post a Comment for "Adding Decorations Using Materialcalendarview Binding Library In Xamarin.android"