Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Dynamic ItemDisplayBinding for Picker.

$
0
0

The Picker has ItemDisplayBinding property to set Itemsource's property name to display by using this "{Binding PropertyA}" syntax.
But I have UI conditions that relating with changing property name to display dynamically.
I have a property like this.

    public string GetPropertyToDisplay 
    {
       If (ID == 1)
      {
        return "PropertyA";
      }else if (ID == 2)
      {
       return "PropertyB";
      }
    }

What should I do If I want this property to be binding instead "{Binding PropertyA}" ?


Viewing all articles
Browse latest Browse all 77050

Trending Articles