Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Trigger StartDate Property Refresh on CalendarDay from XamCalendar
posted

I have a XamCalendar that represents days that contain runs from a medial device. I have updated the style for the CalendarDay to reflect this with an Ellipse that sets its background color using a converter from "StartDate". The converter accesses a list of DateTimes and sets the background for the Ellipse to transparent or a color depending on if the day contains a run. This works well when the calendar is initially loaded, but when a new run is returned, the calendar will not update the Ellipse on the CalendarDay object until it is recycled (typically scrolling two months is enough to recycle the CalendarDay). From the XamCalendar control, calling "UpdateLayout" will not trigger the refresh either. How can I call NotifyPropertyChanged on the CalendarDay objects "StartDate" property from the XamCalendar?

  • 34510
    Offline posted

    Hi Richard,

    Unfortunately there is no way to trigger a notification on the StartDate property as CalendarDay does not expose an OnPropertyChanged method or anything similar and StartDate is a read-only property so you can't change it to trigger a notification.  You will need to create a new property in your view model that your converter can bind to in order to trigger notifications and refresh the converter.  A MultiBinding will probably be a good solution as it will let you bind to multiple properties.  You can bind to the StartDate which you need in the converter and you can add another binding to the view model property which will be used for triggering notifications.