title: Pickview object instead of default keyboard Xamarin.ios
body: <p>I'm trying to implement a pickview object instead of the keyboard on xamarin.ios, I found something on the net but they are not for me. I have to enter a numeric value, required on a TextField which when clicked instead of the standard keyboard will show my pickview. And it will insert it in the field to forward it afterwards to the php script for an insertion on a data base. I developed this code but I'm stuck, I humbly ask you for help :( 
  Please only c# code, if you would help me.</p>
  
  <p>I display the Picker with my list but when I have to go to retrieve the data and insert it somewhere for example in the Textfield or in a variable to save it and send it to the PHP script I can't get the selected value!</p>
  
  <pre><code>  public override void ViewDidLoad()
      {
          base.ViewDidLoad();
  
          //gesture torna indietro
          var BackGesture = new UISwipeGestureRecognizer(swipe);
          BackGesture.Direction = UISwipeGestureRecognizerDirection.Right;
          BackGesture.NumberOfTouchesRequired = 1;
          View.AddGestureRecognizer(BackGesture);
          //evento torna indietro
          void swipe(UISwipeGestureRecognizer sw1)
          {
              //torno indietro
              apriStoryBoard("Home");
          }
          var list = new List&lt;string&gt; { "1", "2" };
          ConfigurePicker(list);
  
  
         // picker.Model = colorsViewModel;
  
      }
  
      void ConfigurePicker(List&lt;string&gt; list)
      {
          var pickerTextField = new UITextField();
          var picker = new UIPickerView();
          picker.Model = new ColorsViewModel(list);
  
          var screenWidth = UIScreen.MainScreen.Bounds.Width;
          var pickerToolBar = new UIToolbar(new RectangleF(0, 0, (float)screenWidth, 44)) { BarStyle = UIBarStyle.Default, Translucent = true };
          var flexibleSpaceButton = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
          var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, (sender, e) =&gt; Rips1.ResignFirstResponder());
          pickerToolBar.SetItems(new[] { flexibleSpaceButton, doneButton }, false);
  
  
           var colorsViewModel = new ColorsViewModel(list);
  
           colorsViewModel.ColorChange += (sender, e) =&gt;
           {
  
              Rips1.Text = colorsViewModel.SelectedColor;
           };
  
  
  
          Rips1.InputView = picker;
          Rips1.InputAccessoryView = pickerToolBar;
  
      }
  </code></pre>
  
  <p>PickviewModel class:</p>
  
  <pre><code>class ColorsViewModel : UIPickerViewModel
  {
      List&lt;string&gt; list;
  
      public event EventHandler ColorChange;
      public string SelectedColor { get; private set; }
      public override System.nint GetRowsInComponent(UIPickerView pickerView, nint component) //non e uguale
      {
          return list.Count;
      }
  
      public ColorsViewModel(List&lt;string&gt; list)
      {
          this.list = list;
      }
  
      public override System.nint GetComponentCount(UIPickerView pickerView)
      {
          return 1;
      }
  
      public override string GetTitle(UIPickerView pickerView, nint row, nint component)
      {
          return list[(int)row];
      }
  
      //controla la selezione attuale
      public override void Selected(UIPickerView pickerView, nint row, nint component)
      {
          var color = list[(int)row];
  
          SelectedColor = color;
  
          ColorChange?.Invoke(null, null);
      }
  
      public string getValore(nint row)
      {
          return list[(int)row];
      }
  
  }
  </code></pre>