title: How can I modify an UIButton inside a TableViewCell from a TableSource?
body: <h2>What I need</h2>
  
  <p>I have a UITableView, and each of its cells have a CustomCheckBox (which is a UIButton) and a label. I want that, when I click the Row (the RowSelected method), the Selected property of said UIButton changes and therefore changes the Image of the clicked UIButton.</p>
  
  <p>I have a CustomCheckBox.cs</p>
  
  <pre><code>public partial class CustomCheckBox : UIButton
  {
      public CustomCheckBox(IntPtr handle) : base(handle)
      {
          this.SetImage(UIImage.FromBundle("ic_check_on"), UIControlState.Selected);
          this.SetImage(UIImage.FromBundle("ic_check_off"), UIControlState.Normal);
          this.TouchUpInside += (s, args) =&gt;
          {
              this.Selected = !this.Selected;
          };
      }
  }
  </code></pre>
  
  <p>An ItemCellView.cs</p>
  
  <pre><code>public partial class ItemCellView : MvxTableViewCell
  {
      public static readonly NSString Key = new NSString("ItemCellView");
      public static readonly UINib Nib;
  
      static ItemCCellView()
      {
          Nib = UINib.FromName("ItemCellView", NSBundle.MainBundle);
      }
  
      public ItemCCellView(IntPtr handle) : base(handle)
      {
          this.DelayBind(() =&gt;
          {
              var set = this.CreateBindingSet&lt;ItemCellView, ItemViewModel&gt;();
              set.Bind(this.lblDescription).To(p =&gt; p.Description);
              set.Apply();
          });
      }
  }
  </code></pre>
  
  <p>And a TableSource.cs</p>
  
  <pre><code>public class CoberturasOpcionalesSource : MvxTableViewSource
  {
      private PlanMulticoberturaOpcional SelectedItem;
      readonly CotizarMulticoberturaViewModel ViewModel;
  
      private UIViewController parentView;
  
      public CoberturasOpcionalesSource(UITableView tableView, CotizarMulticoberturaViewModel viewModel) : base(tableView)
      {
          this.ViewModel = viewModel;
          this.UseAnimations = true;
          this.AddAnimation = UITableViewRowAnimation.Top;
          this.RemoveAnimation = UITableViewRowAnimation.Middle;
          tableView.EstimatedRowHeight = 30.0f;
  
          tableView.RegisterNibForCellReuse(UINib.FromName(ItemCellView.Key, NSBundle.MainBundle), ItemCellView.Key);
      }
  
      public override nint NumberOfSections(UITableView tableView)
      {
          return this.ViewModel.ObsCollection.Count;
      }
  
      public override nint RowsInSection(UITableView tableview, nint section)
      {
          return 1;
      }
  
      protected override object GetItemAt(NSIndexPath indexPath)
      {
          return this.ViewModel.ObsCollection[indexPath.Section];
      }
  
      public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
      {
          tableView.DeselectRow(indexPath, true);
  
          var cell = (ItemCellView)tableView.DequeueReusableCell(ItemCellView.Key, indexPath);
  
          cell.btnCheckBox.SendActionForControlEvents(UIControlEvent.TouchUpInside);
  
          var item = this.ViewModel.ObsCollection[indexPath.Section];
          if (item != null)
          {
              //
          }
      }
  
      protected override UITableViewCell GetOrCreateCellFor(UITableView tableView, NSIndexPath indexPath, object item)
      {
          var cell = (ItemCellView)tableView.DequeueReusableCell(ItemCellView.Key, indexPath);
  
          return cell;
      }
  }
  </code></pre>
  
  <h2>The problem</h2>
  
  <p>I have a breakpoint on the TouchUpInsde in the CustomCheckbox.cs. When I touch the row, it stops on the TouchUpInside but it doesn't do anything</p>
  
  <h2>The solution</h2>
  
  <p>Thanks to @Garfield81. I was creating a new cell on the RowSelected method. I change it for this:</p>
  
  <pre><code>var cell = (ItemCellView)tableView.CellAt(indexPath);
  </code></pre>