title: How to bind a NSLayoutConstraint's constant properly?
body: <p>I'm developing an app with Xamarin and MVVMCross and I'm having problems creating binding NSLayoutConstraints constants.</p>
  
  <p>I have a view with a Subview that should "disapear" if a certain List&lt;> has no elements, and the content below should move up instead of leaving it's space empty.</p>
  
  <p>To do that I added an NSLayoutConstraint to this view to be able to modify it's height programmatically and I bind it with the following line of code:</p>
  
  <pre><code>var set = this.CreateBindingSet&lt;ActivityView, ActivityViewModel&gt; ();
  set.Bind (ConstraintHeightPictures).To (vm =&gt; vm.Activity.ImageList.Count).For (cons =&gt; cons.Constant).WithConversion ("CountToConstraintHeight", Constants.HeightActivityImages);
  set.Apply ();
  </code></pre>
  
  <p>The CountToConstraintHeightConverter is pretty simple, it just checks if the value is equal to 0 to return 0 or otherwise the default height value (Constants.HeightActivityImages).</p>
  
  <p>The code gives no execution error and passes through the Converter but when I run the app, the View is still there, empty.</p>
  
  <p>On the other hand if I run the following line of code inside <code>ViewWillLayoutSubviews</code> it works perfectly but it's not binded.</p>
  
  <pre><code>ConstraintHeightPictures.Constant = ViewModel.Activity.ImageList.Count &gt; 0 ? Constants.HeightActivityImages : 0.0f;
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>Many thanks in advance!</p>
  
  <p>Jordi</p>