Add a new element in the calendar

May 20, 2009 at 6:44 AM

I want to add a new content presenter to display the selected date information as: Wensday, Apir 2009 into the calendar, then how to realize?

The whole calender will be like this:

Su Mo Tu We Th Fr Sa

 1   2   3    4    5  6  7


Wensday, Apir 2009



May 29, 2009 at 1:30 AM

You would have to re-template the Calendar to include your new element at the bottom then bind that element's content/text to the Calendar's SelectedDate.

Here is an example of the Binding: 

<TextBox  Text="{Binding ElementName=yourCalendar, Path=SelectedDate, StringFormat='D'}" />

The 'D' specifies the formatting that is returned by the DateTime's ToString(String). For more info, see:

-Eric, MSFT