.NET MAUI TimePicker custom selection of time

Faizan Ahmed Khan 0 Reputation points
2023-07-04T09:37:29.7866667+00:00

Hi,

In .NET MAUI timepicker I would like the users of my application to select minutes in the increment of quarter hours.

For example I want the users to select minutes in the form of 0 15 30 45 nothing else must be allowed to select

I am unaware of any property available currently that allows me to implement this functionality

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,900 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,274 questions
{count} votes

1 answer

Sort by: Most helpful
  1. dg2k 1,401 Reputation points
    2023-07-04T14:54:04.61+00:00

    Use the Picker control which is described here.

    You can populate directly in XAML with string or integer values (no elaborate model and binding would required since all you want to capture one of 4 values). The only binding you may need is the SelectedItem property of Picker which provides user selected value.

    The link provided gives more help with explanations.

    LATER: Re-reading your question I believe you want to do with the TimePicker control itself. I doubt it much if TimePicker has a cutomizable granularity for time increments.

    The Telerik version has added properies for customizable increments as you describe, but it is an added value perhaps with licensing implications.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.