Bindable Picker in Xamarin Forms(MVVM)

Picker is a great control for selecting one option from the multiple options.

But  If your developing your project using MVVM Framework then you surely get problem while using picker.
The reason is ITEMS property in picker is not bindable property .So Now you must be wondering that how to use a picker then in MVVM.To get this answer you might go from one forum to another forum and you get good custom  bindable picker,but then all these picker have some problems.So I without any wasting your much more time suggest to use Jpc.BindablePicker

To Use Bindable Picker,first we need to add the namespace in the xaml file




Now Add the BindablePicker in the xaml



As you have checked the “ItemSource” property is not available in the regular picker.
Now Next Step is to bind the properties in the ViewModel.






Now if you want to get the selectedItem from the picker just  use
 ItemSelectedFromList.ToString();

So In this way you can use the bindable Picker.
If you like this tutorial or if you have any query to ask then please comment below!


Comments

Post a Comment

Popular posts from this blog

FilePicker In Xamarin Forms

How to Use Media Picker In Xamarin Forms Portable

Scrolling Problem ListView in ScrollView (Solved)