I have been fine-combing the web for any guidance, discussions or experience on this and I think I can safely say there’s nothing to be found.
We are developing a set of controls for UWP which we plan to open source and make available for free. One of the controls we are building is a TimeSpanPicker
control, which will essentially look and behave like the TimePicker
control, but instead of being limited to a time of day (i.e. 24 hour interval) it will allow the user to edit an arbitrary TimeSpan
.
From what I have been able to piece together from the visible metadata of the Windows Runtime API, using the built-in TimePicker
control for reference, I am realizing the following types of components are involved:
- The TimePicker control itself which inherits from
Control
- The TimePickerFlyout class which inherits from
PickerFlyoutBase
- The TimePickerFlyoutPresenter control, which inherits from
Control
I realize I need to mimic this pattern and write these three components for our picker control, but I can find no information about how these pieces fit together, and from the API surfaces alone I don’t think it’s possible to figure it out.
Specifically, the primary things I’d like to understand are:
- How is the
TimePickerFlyout
incorporated into theTimePicker
class? I can see no reference to a flyout anywhere within the default template of the picker control. - What role does the
TimePickerFlyoutPresenter
control play, and how is it incorporated into theTimePickerFlyout
class? TheTimePickerFlyout
class has no template – so how does it instantiate and communicate with theTimePickerFlyoutPresenter
control? - What are the basic steps to mimic this pattern?
- What is the intended use of the
ShouldShowConfirmationButtons
andOnConfirmed
virtual methods onPickerFlyoutBase
? When I override them in my concrete implementation, they are never called.
I’d be very thankful for any guidance!