MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.34k stars 2.44k forks source link

TimePicker SelectedTime #4080

Open amellini opened 3 years ago

amellini commented 3 years ago

TimePicker should have a property for time-only values (as the name of the control)

TimePicke use a SelectedDateTime property for selected value which use a DateTime?, this is pretty funny because for this kind of value we can user DatePicker (which can show the time part), for time property there's a TimeSpan so why (in an approved PR) you changed this behavior?

In .net Time are represented by TimeSpan, if you wan't break current implementation please add a SelectedTime property to use the correct data type instead of using a converter.

timunie commented 3 years ago

Hi @amellini

this control is meant to select a time of the day which is different from selecting a TimeSpan. A TimeSpan can also be about a longer period. There is another feature request open for a TimeSpan-Control: #3718

Happy coding Tim

amellini commented 3 years ago

I dont fully agree, TimeSpan in used to represent a time interval (TimeSpan) but "DateTime.Now.TimeOfDay" return a TimeSpan, so its used to represent a generic time of a generic day (not a specific as requested by a DateTime structure).

I think that creating a new usercontrol specific for this kind of data instead using an existing (note that TimePicker is different from DateTimePicker so i expect a generic Time not a specific Time of a specific Day) will be confusing.

pastukh0v commented 3 years ago

Fully agree with the author. Moreover, in version 1.6.5 TimeSpan was used for the SelectedTime property and I don't see a reason why DateTime should be used if the control only allows to work with Time what implies using TimeSpan instead of DateTime.