Naresh Goradara
Naresh Goradara

Reputation: 1896

Customize WPF Calendar header

I need to customize wpf calendar header- Month title, Day header etc. The extra text can be added on calendar title, and its day title can also modified.

I have tried by referring this. The older version of WPF toolkit is used in it, and it is not available in newer one. It is integrated with WPF itself. So, the day title header is not displayed over there.

I am using .Net 4.0, and Visual Studio 2010 for development. I am not using any other designer software like Blend.

Please let me know your ideas to achieve this.

Thanks in Advance, N

Upvotes: 1

Views: 2369

Answers (1)

Olly
Olly

Reputation: 6026

It sounds as though you need to create a custom control template. How you do this depends on what tools you have available to you. If you have a version of Blend that handles WPF (see here for a link to one that you can download because it's a preview version) you can create a control template from the default template.

In Blend the process is as follows:

  1. add a Calendar control using the designer,
  2. right click and select Edit Template | Edit a Copy...',
  3. choose where to create the new style (best to add a resource dictionary),
  4. do the same again to create a tepmplate for the CalendarItem that contains the visuals for the Calendar,
  5. make the desired changes to the template using the designer, and finally
  6. click on the word [Calendar] in the breadcrumb below the title bar to return to the normal design mode.

If you don't want to install Blend, you can use the sample template for the WPF calendar from the MSDN site instead.

Upvotes: 1

Related Questions