The silverlight datepicker can zoom out to allow a user to select by year, but for some reason the first and last years always look disabled. Is there a way to prevent this?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is one of the many places where the color and style of elements are hardcoded into their default templates. Hence to change the appearance of these “inactive” calendar buttons you need to define a new template.
First you need to create a copy of the
controlsPrivitives:CalendarButtonstyle, you can get a copy of the style from Calendar Styles and Templates. Place this in theResourcesfor your user control or even in your App.Xaml. You’ll need to copy the namespace aliases also listed in that MSDN topic.Now you have your own implicit style for the calendar button that you can modify. You’ll note the template in that xaml has this visual state group:-
Those years outside of the range are set to the Inactive state and therefore have the hard coded grey color you see in the Inactive state above. So tweak this xaml to your preference.
If you want the same for day buttons you should note that these have a different control
CalendarDayButtonso you’ll need to do the same exercise on its default style.