title: How to dynamically add a picker
body: <p>I have a button on my screen and when I press the button I want a picker to show up with a list of items and when an item is chosen the text of the button should change to that and the picker should go away.</p>
  
  <p>This is my code:</p>
  
  <pre><code>Picker picker = new Picker
      {
          Title = "What's in the slot?",
          VerticalOptions = LayoutOptions.CenterAndExpand
          //HorizontalOptions = LayoutOptions.Center 
  
      };
  </code></pre>
  
  <p>And the function which is called when the button is pressed:</p>
  
  <pre><code>private void Displaypickerview(int row, int column)
      {
          if (status == "filling board")
          {
              foreach (string text in pickerText)
              {
                  picker.Items.Add(text);
              }
              foreach (string ore in oreLevels)
              {
                  picker.Items.Add(ore);
              }
  
  
              picker.SelectedIndexChanged += (sender, args) =&gt;
              {
                  if (picker.SelectedIndex == -1)
                  {
  
                  }
                  else
                  {
                      //change value of cell and button
                      Picker picker = (Picker)sender;
                      int index = picker.SelectedIndex;
  
                      if (index &lt; pickerText.Length)
                      {
                          board[row, column].Text = pickerText[index - 1];
                      }
                      else {
                          board[row, column].Text = oreLevels[index - 1 - pickerText.Length];
                      }
                  }
              };
          }
          else if (status == "choosing item")
          {
  
          }
  
      }
  </code></pre>
  
  <p>But I don't know how i should render the picker view on the screen and remove it afterwards.</p>
  
  <p>Update:</p>
  
  <p>What is the eventhandler of the done button in the picture below.</p>
  
  <p><a href="https://i.stack.imgur.com/j8EEh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j8EEh.png" alt="Picker"></a></p>