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.28k stars 2.45k forks source link

TimeSpan Up/Down #3718

Open Symbai opened 4 years ago

Symbai commented 4 years ago

Does something like a timespan up/down exist in MahApps Metro? I've tried NumericUpDown control but that only allows a double value. And the TimePicker control is... a time picker, great if you want to choose a day time. However I would need the user to choose a value within a specific time range (more like within a duration) only.

The extended toolkit has such a control: https://github.com/xceedsoftware/wpftoolkit/blob/1e0b826e1fca8cdb2bb4640194c906ac23e53c2b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/TimeSpanUpDown/Implementation/TimeSpanUpDown.cs

Revan654 commented 4 years ago

Out of the Box I don't believe so.

Have you tried using string format with your binding? Which has built in Time formats.

There also a large range of number parsing types built in from Currency to Float, Maybe something in that Option could also help.

Then you can add in Validation(To limit the user to a certain range). In Min to MaxRange Doesn't work for you.

Symbai commented 4 years ago

I've tried time formats but you cannot format a double value to a time string. It would also need support if the user selects the hour and press up/down to increase the hour instead of second / millisecond. So this won't work. And in such case validation won't help either.

Guess I will leave the issue open as kind of a request then.