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
15
How do I programmatically style each day in the XamDateNavigator?
posted

Hello,

How do I programmatically style each day in the XamDateNavigator?

At the moment I only see a HighlightDayCriteria which highlights days with activities. I want to be able to highlight and customize specific dates and also be able to give those days a background or different foreground color.

For example, if I have a list of DateTime, I'd like to be able to color these days in XamDateNavigator.

Any help is appreciated.

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello Jeffrey,

    Styling each day in the XamDateNavigator is somewhat tricky, as the date navigator uses a concept of “calculated colors” rather than using the Background/BorderBrush/Foreground properties. The item that you would need to style in this case is the CalendarDay, but you will need to include the default style and modify it such that it uses Background/BorderBrush/Foreground rather than the “Computed” counterpart to those.

    The issue with this route is that you will then need to define a trigger for your selection/activation of a particular date. I am attaching a sample to demonstrate how you could do this. This sample colors all of the dates Red while allowing the selected/active dates to appear as a LightBlue color.

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.

    XamDateNavigatorStylingCase.zip

Children
No Data