Commands
TimeSpanPicker Commands
TimeSpan Picker for Xamarin exposes the following commands you can use to programmatically manipulate displaying the popup as well as clearing the selected time interval:
- ToggleCommand(ICommand): Allows you to show/hide the popup used for selecting a time interval.
- ClearCommand(ICommand): Allows you to clear the displayed time interval.
Example for ToggleCommand and ClearCommand
also you need to add the following namespace:
PopupSelector Commands
Through the popup users can pick a time interval. The time interval value should be confirmed or rejected through the OK and Cancel buttons placed on the popup.
TimeSpan Picker allows you to add a custom logic for the Accept and Cancel commands which are executed when OK and Cancel buttons, respectively, are pressed.
- AcceptCommand(ICommand): Defines the command which confirms the current selection of the picker and closes the popup. AcceptCommandParameter can be used to pass a parameter to the command execute method.
- CancelCommand(ICommand): Defines the command which rejects the current selection of the picker and closes the popup. CancelCommandParameter can be used to pass a parameter to the command execute method.
The Accept and Cancel commands can be applied using the SelectorSettings property of RadTimeSpanPicker. In addition, you can pass command parameters through the AcceptCommandParameter
and CancelCommandParameter
properties of the TimeSpanPicker SelectorSettings.
Here is a quick example on how they could be set:
Example for AcceptCommand and CancelCommand
and the ViewModel
also you need to add the following namespace: