Hi,
I'm trying to achieve several customization on a single calendarbuttonitem (date) according to a series of date attributes, i.e.:
1. Holidays should have a colored background
2. Wednesdays should be bolded
Now I can achieve this easily using the DayTemplateSelector for each of the above separately by checking for wednesdays and returning a "wednesdayTemplate" that bolds the text, and for holidays returning a "holidayTemplate" that sets the background color.
But what if the date is both a wednesday and a holiday, I would like to add both styles. The real case is much more complicated, hence I can't accept simply creating a third template combining the styles.
What I really need is having only one template that are capable of binding to multiple values. It would be sufficient if I somehow could build the template in code behind rather that binding it in XAML, i.e. accessing the template setting backgroundcolor and font.
Is this possible, and what would be the recommended approach?
Thanks in advance!
Best regards,
Kasper Schou
I'm trying to achieve several customization on a single calendarbuttonitem (date) according to a series of date attributes, i.e.:
1. Holidays should have a colored background
2. Wednesdays should be bolded
Now I can achieve this easily using the DayTemplateSelector for each of the above separately by checking for wednesdays and returning a "wednesdayTemplate" that bolds the text, and for holidays returning a "holidayTemplate" that sets the background color.
But what if the date is both a wednesday and a holiday, I would like to add both styles. The real case is much more complicated, hence I can't accept simply creating a third template combining the styles.
What I really need is having only one template that are capable of binding to multiple values. It would be sufficient if I somehow could build the template in code behind rather that binding it in XAML, i.e. accessing the template setting backgroundcolor and font.
Is this possible, and what would be the recommended approach?
Thanks in advance!
Best regards,
Kasper Schou