New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI Chat TimePicker

The RadChatPicker control provides a TimePickerContext that can be used to display a clock view to choose a time.

TimePickerContext exposes the following properties that you can use to adjust the clock items:

  • SelectedValue—Defines the currently selected time.
  • StartTime—A property of type TimeSpan that represents the starting time of the clock's items.
  • EndTime—A property of type TimeSpan that corresponds to the time of the last clock item.
  • TimeInterval—A property of type TimeSpan that defines the step between the clock's items. Te default value is 1 hour.

Here is a quick example on how to use the TimePicker in RadChat:

TimePickerContext context = new TimePickerContext
{
    StartTime = TimeSpan.FromHours(1),
    EndTime = TimeSpan.FromHours(5),
};
PickerItem pickerItem = new PickerItem { Context = context };
chat.Items.Add(new TextMessage { Text = "Select a time" });
chat.Items.Add(pickerItem);
context.PropertyChanged += (s, e) =>
{
    if (e.PropertyName == "SelectedValue")
    {
        if (context.SelectedValue != null)
        {
            chat.Items.Remove(pickerItem);
            chat.Items.Add(new TextMessage { Author = chat.Author, Text = "" + context.SelectedValue });
        }
    }
};

Chat with TimePicker

.NET MAUI Chat Message

See Also

In this article