Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimePicker reset on clock/popup click #3931

Closed
TheCamel opened this issue Oct 5, 2020 · 11 comments · Fixed by #3932
Closed

TimePicker reset on clock/popup click #3931

TheCamel opened this issue Oct 5, 2020 · 11 comments · Fixed by #3932
Labels
Milestone

Comments

@TheCamel
Copy link

TheCamel commented Oct 5, 2020

Each click on the clock to open the dropdown send a new value as 'null', something wrong ? Time is a "DateTime?" property

<MahApps:TimePicker SelectedDateTime="{Binding Time}"
SelectedTimeFormat="Short"
PickerVisibility="HourMinute" HandVisibility="HourMinute"
/>

was working with the 1.6.5 version

@TheCamel TheCamel added the Bug label Oct 5, 2020
@timunie
Copy link
Collaborator

timunie commented Oct 5, 2020

Hi @TheCamel ,

which version of MahApps do you use? It would be the best, if you use the Bug-Template next time.

If you can share a sample App it might also be useful.

Thank you & Happy coding
Tim

@TheCamel
Copy link
Author

TheCamel commented Oct 5, 2020

sorry for the issue template, version 2.2.0
btw,
why do you change from TimeSpan to DateTime ?

I cannot compile the latest source of Demo (all errors related to time control or textboxhelper)
MahApps.Metro is build ok

and also had unexplained troubles with themes when i try to update from 1.6.5 to 220 :-)
sorry have to go back to 165 because application in production

@timunie
Copy link
Collaborator

timunie commented Oct 5, 2020

@TheCamel please read this: https://mahapps.com/docs/guides/migration-to-v2.0 . I think it explains much about what is going on with Theming.

@TheCamel
Copy link
Author

TheCamel commented Oct 5, 2020

Thanks, i allready seens that one, but had trouble with the Styles/Themes/Dark.Blue.xaml
i can't find out...
but don't care i go back to 165

@TheCamel
Copy link
Author

TheCamel commented Oct 5, 2020

I achieve to build the lastest source and you have the same problem with the time control (latest in the right panel ) in the demo application: click the clock and change the time, validate; it is ok
re click the clock, control gets empty and red, display an error
bye

@timunie
Copy link
Collaborator

timunie commented Oct 6, 2020

Hi @TheCamel ,

thank you for this updated comment 👍. I can now reproduce this issue with the latest demo.
Seems like it comes from using AM and PM notation. TimeSpan.TryParse cannot accept this. I have an idea and will try to provide a fix for that.

Happy coding
Tim

@TheCamel
Copy link
Author

TheCamel commented Oct 6, 2020

Hi @timunie ,
you're welcome, it seams it exist since 2.0
See u

@TheCamel
Copy link
Author

TheCamel commented Oct 6, 2020

hi, by the way I find it unfortunate that the control manages a DateTime and not a TimeSpan; the most logical unit of time in base is an "integer / long"; i don't want to manage a string or a date to store a time / hour for scheduling; this will lock me to the 165, do i have to create a feature request?

@punker76
Copy link
Member

punker76 commented Oct 6, 2020

@TheCamel This was changed by this PR #3254 (original #2763 ) . So both classes , TimePicker and DateTimePicker, use DateTime? which is also used by the WPF DatePicker. One way is to use a value converter which stores the DateTime? as TimeSpan and back. Or you just use the DateTime? value.

@TheCamel TheCamel closed this as completed Oct 7, 2020
@timunie
Copy link
Collaborator

timunie commented Oct 7, 2020

@TheCamel why did you close this issue? There is definitive an issue with storing / converting the value. The possible solution (see #3932 ) is not implemented yet.

@TheCamel
Copy link
Author

TheCamel commented Oct 7, 2020

sorry, it's a mistake. I let you manage the status when done :-)

@TheCamel TheCamel reopened this Oct 7, 2020
@punker76 punker76 added this to the 2.2.1 milestone Oct 7, 2020
punker76 added a commit to timunie/MahApps.Metro that referenced this issue Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants