日历与日历之间的区别WPF中的日期选择器控件

日历与日历之间的区别WPF中的日期选择器控件

本文介绍了日历与日历之间的区别WPF中的日期选择器控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日历"与"WPF中的日期选择器控件?有选择任何一个的标准吗?

Difference between Calendar & Date Picker control in WPF? Is there any criteria of choosing the either of them?

推荐答案

每个 DatePicker文档:

许多DatePicker控件的属性用于管理其内置日历,其功能与等效属性在日历中.[片段]欲了解更多信息,请参阅日历.

Many of a DatePicker control's properties are for managing its built-in Calendar, and function identically to the equivalent property in Calendar. [snip] For more information, see Calendar.

该文档中的日历"链接直接指向WPF日历控件,因此...

The Calendar links in that documentation lead directly to the WPF Calendar control, so...

根据我的理解,DatePicker是必不可少的控件,它包含一个日历,该日历在用户单击下拉菜单之前是不可见的,而该日历始终是可见的,除非您提供其他标记和代码以达到相同的效果

From my understanding, the DatePicker is essential a control that contains a calendar that is not visible until the user clicks on the drop-down, while the calendar is always visible, unless you provide additional markup and code to achieve the same effect.

因此,当您希望始终在页面上始终显示完整的日历时,可以使用日历,而如果您想要更紧凑的内容,则可以使用DatePicker.

So you'd use a calendar when you want a full calendar visible on the page at all times, and a DatePicker when you want something more compact.

亲自使用它来选择日期时,除非有理由显示日历,否则我总是选择DatePicker.例如,如果我正在创建一个应用程序,可以在注册过程中输入生日,那么我将使用DatePicker.

When using it to select dates, personally, I'd always choose the DatePicker unless I had a reason to display the calendar. For example, if I were creating an app that lets me enter my birthday a s a part of the registration process, I'd use a DatePicker.

我可能会在计划应用程序中使用日历,也可能在约会日历中使用日历.这样的应用可能每天都显示其他数据,这些数据代表约会或计划的班次.在这种情况下,我希望它始终可见.

I might use the Calendar in a schedule app, or an appointment calendar. Such an app may have additional data displayed in each day, representing appointments or scheduled shifts. IN that case, I'd want it always visible.

但实际上,使用哪个是每个应用程序的设计决定.

But really, which to use is a per-app design decision.

这篇关于日历与日历之间的区别WPF中的日期选择器控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 00:55