/// <summary>
        /// Coerces the index of the selected.
        /// </summary>
        /// <param name="bindable">The bindable.</param>
        /// <param name="value">The value.</param>
        /// <returns>System.Int32.</returns>
        private static int CoerceSelectedIndex(BindableObject bindable, int value)
        {
            BindablePicker picker = (BindablePicker)bindable;

            if (picker.Items != null)
            {
                return(value.Clamp(-1, picker.Items.Count - 1));
            }
            return(-1);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PickerSource"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public PickerSource(BindablePicker model)
 {
     _model = model;
 }