wpf calendar control - subclass
I have the word "subclass" in the title because that's the only idea I have for doing this, but maybe not?
What I need is to only use the years of a calendar control - I don't need either the months view nor the days view. I thought of writing a custom control that does this, but since calend开发者_如何转开发ar already has the very cool "Decade" view, I wanted to use that.
I tried handling the DisplayDateChanged event and forcing the mode back to Decade, but what happens is that the months show on click, and then disapear showing the Decade view again.
Any "interesting hacks" for doing this?
In C++, I always knew I can do a "real subclass" and intervene in the control's behavior - Can this be done?
Check out this article on styling for the Calendar control, it may get you started.
http://msdn.microsoft.com/en-us/magazine/dd882520.aspx
精彩评论