WPF 日历控件 - 子类
我的标题中有“子类”一词,因为这是我这样做的唯一想法,但也许不是?
我需要的是仅使用日历控件的年份 - 我不需要月份视图或天视图。我想编写一个自定义控件来执行此操作,但由于日历已经具有非常酷的“十年”视图,因此我想使用它。
我尝试处理 DisplayDateChanged 事件并强制模式返回十年,但发生的情况是单击时显示月份,然后消失,再次显示十年视图。
有什么“有趣的技巧”可以做到这一点吗?
在 C++ 中,我一直知道我可以做一个“真正的子类”并干预控件的行为 - 这可以做到吗?
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 calendar 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论