C# WP8 Open TimePicker from code

旧城冷巷雨未停 提交于 2019-12-24 12:33:46

问题


How can I open the TimePicker to select new time but from C#? Not by tapping the control.

Is there any simple way to do that?


回答1:


I had the same problem once. I solved it by forking the Windows Phone Toolkit and making the OpenPickerPage of the control public.




回答2:


(I assume you mean the Windows Phone Toolkit TimePicker control here.)

From reading the source code of the DateTimePickerBase, it would seem not. Opening the picker page is done by the OpenPickerPage() method, which is private, and is only called from the OnDateButtonClick method, which is also private and handles the Click event on a private Button.

Of course, as the control is open-source, you can take the source code of the control and make your own copy of it with one of these methods exposed. As far as I can tell, it's allowed under the Ms-PL.



来源:https://stackoverflow.com/questions/22286869/c-sharp-wp8-open-timepicker-from-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!