(I tried editing my original post, and it lost all formatting. Re-posting...)
I am trying to modify the calendar to only display days in the current month (e.g. if I am looking at May, any cells for April or June are completely blank - no date, appointments, etc.)
I have had some success with listening to the OnMonthCellLoaded event and setting an empty View if the day is outside the current month:
private void MonthCellLoaded(objectsender,MonthCellargs)
{
if (args.Date.Month != _calendar.DisplayDate.Month) { args.View = newGrid(); }
}
This seems to work pretty well until the user swipes to change months. To enable swiping, the above logic runs on all days in the current month as well as all days in the previous and next months. But, as far as I can tell, there's nothing in the args to indicate the month for which the cell is being loaded, so the entire previous and next months are blank as the user swipes:
So my questions are:
- Is there a way to tell, during the OnMonthLoadedEvent, whether a cell is being loaded for its own month or an adjacent month?
- Is there some other entirely different way of accomplishing this?
Thanks in advance!