Multi Picker
Inherits from Xamarin.Forms.Label
The multi picker will allow the user to make multiple selections from a list of available items. If the field is not marked as required then the user can also leave it empty. When the field is tapped then a new model screen is shown with the list of items and a toggle for each one.
Properties
Property
Type
Description
Label
string
The label title to be used when wrapped in a control that displays a label for the field.
IsRequired
bool
If True then any validation performed will require that at least one value be selected.
Items
List
The items to be made available for user selection. (readonly)
SelectedItems
IEnumerable<PickerItem>
The items that have been selected by the user. (readonly)
SelectedValues
IList<string>
The item values that have been selected by the user.
SelectedValuesAsDelimited
string
The selected values as a comma delimited string. Useful with bindings to send the selected values back to the server. (readonly)
Example
As you can see in this example, the SelectedValues
property can be used to set the initial selection with a comma delimited string. There is some magic happening in XAML that allows that to work. But you try to bind to that property or read it's value then you get an array of strings back. That is why the SelectedValuesAsDelimited
property exists, it automatically converts that array into a comma delimited string for you.
Last updated