From the course: .NET 9 Maui: Enhanced Features for Cross-Platform Development

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

TimePicker TimeSelected event

TimePicker TimeSelected event

- [Instructor] The TimePicker view has gotten an update in .NET 9 Maui. There is a new event named TimeSelected that is fired when a new time is selected in the control. The event passes in the old time value and the new time as part of the event arguments. The TimePicker sets the current time via the time property. Any property bound to the time property will fire before the TimeSelected event. This is important to realize, the TimeSelected event may tell you what the old value was and what the new value will be, but it does not allow us an opportunity to validate it before the new value is set into whatever the time property is bound to. At best, we can set it back. Another thing to realize about the TimeSelected event is that it is just that, an event. It isn't a command or property that can be easily bound to. This limits the ability in xaml to easily bind directly to something like a view model. The final limitation is that at the time of this writing, there is a bug where if we…

Contents