title: Customs binding cross views in mvvmcross
body: <p>I need a custom binding and I know when and where but I don't know how I can do it. This is the relation of the view in my custom binding. Think about the *Views like controls.
  <img src="https://i.stack.imgur.com/oTpD6.png" alt="enter image description here"></p>
  
  <p>I have the connections from ViewModel->ContainerView->FirstView but I can't connect it with the TableView. To connect the ContainerView to FirstView I did a custom binding (in one direction for now). And in the setvalue method I call the firstview's method SetBinding (where I want to do the binding)</p>
  
  <p>I tried a few option but nothing happens, the last one looks like this:</p>
  
  <pre><code>public GolferList CurrentGolferList { get; set; }
      public void SetBinding(GolferList golferList){
          this.CurrentGolferList = golferList;
  
          TableSource = new TableSourcePlayers(TableViewPlayers);
          var bindingDescription = new[]{
              new MvxBindingDescription {TargetName = "ItemsSource",SourcePropertyPath = "CurrentGolferList"} ,
          };
  
          Binder.Bind(this,TableSource, bindingDescription);
  
          TableViewPlayers.Source = TableSource;
          TableViewPlayers.ReloadData();
  
      }
  </code></pre>
  
  <p>I would be grateful if you could tell me another way to handle it. </p>
  
  <p><strong>Update</strong>: 
  I followed Stuart's link and now it works fine, thanks a lot Stuart! 
  Actually, in my scheme the TableView is a MvxSimpleBindableTableViewSource and I want to bind the data there. So in order to make it work, I used the code below (SetBinding needs some external refactor):</p>
  
  <pre><code>    private List&lt;IMvxUpdateableBinding&gt; bindings;
      private string BindingText = "{'ItemsSource':{'Path':'CurrentGolfers'}}";
     public object DataContext { 
          get { return dataContext; }
          set { dataContext = value;
              if (bindings == null)
                  bindings = this.GetService&lt;IMvxBinder&gt;().Bind(dataContext, TableSource, BindingText).ToList();
              else
                  bindings.ForEach(b =&gt; b.DataContext = dataContext);
             }
          }
      public void SetBinding(GolferList golferList){
          this.DataContext = PlayViewModel;
          tableView.Source = TableSource;
          tableView.ReloadData();
     }
  </code></pre>
  
  <p>Note that BindingText points to the table, not to the view itself.</p>
  
  <p><strong>Update 2</strong>
  Now in V3 it's a bit different. First, the view must implement IMvxBindable and this members:</p>
  
  <pre><code>    public object DataContext
      {
          get { return BindingContext.DataContext; }
          set { BindingContext.DataContext = value; }
      }
  
      public IMvxBindingContext BindingContext { get; set; }
  </code></pre>
  
  <p>(Don't forget dispose calling BindingContext.ClearAllBindings() and also call to CreateBindingContext() in the viewload )</p>
  
  <p>And then you'll be able to bind in your class. In my case:</p>
  
  <pre><code>    var set = this.CreateBindingSet&lt;FirstPlayViewController, PlayViewModel&gt;();
      set.Bind(source).To(vm =&gt; vm.CurrentGolfers).Apply(); //I love the new fluent api :)
  </code></pre>