I’ve updated the BindablePicker from a previous blog post, added new features and created a github reopro for the code.
Xamarin Forms is a new and cool API for quickly building native apps for IOS, Android, and Windows UWP in C#.
The Xamarin Forms API comes with a primitive Picker control that lacks typical bindable properties that developers expect a Picker (similar functionally that a desktop ComboBox has) to have.
Xamarin Forms makes it very easy for developers to extend the API, write your own custom controls, or write custom renderers for controls.
This BindablePIcker is the result of studying blog and forum posts and receiving feedback and bug report on the original version.
Xamarin Forms Picker API
- SelectedIndex (bindable)
- Items (not bindable)
Bindable Picker API
- ItemsSource (bindable)
- SelectedItem (bindable)
- SelectedValue (bindable)
New Features Added
- Support for collections that implement INotityCollectionChanged like the ObservableCollection
The original BindablePicker did not correctly set the SelectedItem after the ItemsSource was refreshed at runtime.
Bindable Picker Source
This repro contains a project that demonstrates scenarios for using this control and it has the source for the BindablePicker.
Training Video – XAML Power Toys BindablePicker Scenarios
This short video explains three common use cases for the BindablePicker.
Have a great day.
Just a grain of sand on the worlds beaches.