I had the same problem once. I solved it by forking the Windows Phone Toolkit and making the OpenPickerPage
of the control public.
C# WP8 Open TimePicker from code
-
11-06-2023 - |
質問
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?
解決
他のヒント
(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.
所属していません StackOverflow