Picker ItemTemplate

predalphapredalpha FRMember ✭✭
edited September 2017 in Xamarin.Forms


A Picker allowing to apply a DataTemplate (DataTemplateSelector) to display more detailed informations.
And why not a grouping one above?

API Changes

  public DataTemplate ItemTemplate
            get { return (DataTemplate)GetValue(ItemTemplateProperty); }
            set { SetValue(ItemTemplateProperty, value); }

        public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(nameof(ItemTemplate),
                                                                                               propertyChanged: OnItemTemplateChanged);

Intended Use Case

Today, the native Xamarin.Forms Picker view allows developpers to bind an ItemSource and to display a line of text via ItemDisplayBinding property.
It could be interesting to display more accurate datas as a text line can be very limitating.

For example we could diplay a list of countries with theirs flags images. Moreover a grouping template could be interesting as we could then display continents and their respective countries.

I imagine that we can find workarounds as opening a modal page including a listview but i think having that native templated control could be a very interesting feature.

Whats your opinion ?


Open · Last Updated


Sign In or Register to comment.