title: How to bind Picker in Xamarin.Forms
body: <p>So I've been wanting to bind the items of two pickers in Xamarin.Forms to my ViewModel. I have mainly used binding for textfields, where I just write something like:</p>
  
  <pre><code>&lt;Label Text="{Binding CurrentDate}" /&gt;
  </code></pre>
  
  <p>and simply by setting the binding context, defining a property in the viewmodel</p>
  
  <pre><code>    public System.DateTime CurrentDate{
          get { return currentDate; }
          set { currentDate = value; PropertyChanged(this, new PropertyChangedEventArgs("CurrentDate")); }
      }
  </code></pre>
  
  <p>I am done binding. Now I have two pickers. The pickers represent a map/dictionary. Dictionary>. "A" is mapped to {"1","2"} and "B" is mapped to {"4","5"}. The first picker should show "A" and "B" as options. The second one should display the values associated with the chosen value from the first picker.</p>
  
  <p>So there are two questions. 1) How do I bind a picker? 2) How do I bind a picker that has data that depends on another pickers selection?</p>
  
  <p>I tried</p>
  
  <pre><code>&lt;Picker Items="{Binding ItemsA}"&gt;&lt;/Picker&gt;
  </code></pre>
  
  <p>With a matching property</p>
  
  <pre><code>    public List&lt;string&gt; ItemsA
      {
          get { return itemsA;}
          set { itemsA = value;PropertyChanged(this, new PropertyChangedEventArgs("ItemsA")); }
      }
  </code></pre>
  
  <p>Am I missing out on something here? Help would be appreciated.</p>