Avalonia
Avalonia copied to clipboard
TimePicker No Select Second
why?
I believe this control is migrated from winui, the original design is like this. Need some improvement.
I need this, too.
This design is actually unreasonable. It may not take seconds on apps, but selecting seconds on PCs is necessary and switch control can be added
I think this should be controllable by a property. I don't know which one would be best. I think either
bool ShowSeconds {get; set;}
enum DisplayMode [hh:mm , hh:mm:ss, ...]
Need seconds. Or another type TimePicker with seconds.
@maxkatz6 @robloo would either of you be able to confirm this is a wanted feature? I'd love to pick this up next but, just wanted to make sure it is desired and see if there are any guidelines I should follow while implementing it.
https://github.com/microsoft/microsoft-ui-xaml/issues/1440
TimePicker was designed to be a time picker, not a duration picker. But it's a reasonable request to have such a control. I just don't know if we should extend TimePicker versus adding a new thing.
So, yes - it is "by design". Can be changed though.
Okay, so for now we need to wait for upstream to decide or for the team to have enough time to decide which API is probably the best for Avalonia. Right now I suggest to write a custom control for your usage. If you want, you can share the control in this issue and if later someone thinks it's the right approach, it still can be merged in.
Okay, so for now we need to wait for upstream to decide or for the team to have enough time to decide which API is probably the best for Avalonia.
Well, I don't think we should EVER wait for upstream. WinUI is dying down quite a bit in areas like this. I would be very surprised if there is ever any movement in this space. I do expect they are cooking up several things behind the scenes for Windows 12 though. That said:
Right now I suggest to write a custom control for your usage.
I kind-of agree with this. Second selection is valid in some cases but not for most. I don't think we should complicate the control unless a really good design is found. Perhaps the design is simply to add an optional seconds column which might be fairly straightforward though.
These controls (DatePicker and TimePicker) are also a bit tricky simply due to the way the flyout presenters work. It may not be a great beginning project -- who knows though and I don't want to discourage anything.
Since controls are so widely used I highly suggest providing a visual design for the changes you are proposing and then even a mock-up before any coding here starts.
Hi! Is any progress on this? I'm willing to help, if needed. It would be great feature.
@mate1213 I think my comment is still valid: https://github.com/AvaloniaUI/Avalonia/issues/12045#issuecomment-1669013425
So I see 2 options you can help:
- create your own control extending the original control with these properties added. Would be great if you share the code here.
- Clone Avalonia and work on the implementation proposal and file a PR for us to review when we find the time to do so. (knowing it may be rejected in the worst case). The PR will crteate a nuget package for anyone to test.
If you go with 2), make sure to read build instructions.
Great! Will try to do it the proper 2nd way. :D I will check in when I started.
Just dropping in to say I need a TimePicker that supports seconds too and was quite surprised to see that this isn't a supported feature of TimePicker.
I've submitted PR https://github.com/AvaloniaUI/Avalonia/pull/16079 that adds a new UseSeconds
Property (that defaults to false
keeping existing usages of TimePicker
unaffected) that displays a Seconds column in the TimePicker
Control when set to true
.