title: How to use TimeSpan string format in code in Xamarin.Forms?
body: <p>I am using a <code>Label</code> in Xamarin.Forms in code like so:</p>
  
  <pre><code>var label = new Label();
  label.SetBinding(Label.TextProperty, new Binding("Time", stringFormat: "{}{0:hh\\:mm}", mode: BindingMode.TwoWay, source: this));
  </code></pre>
  
  <p>But this returns the error:</p>
  
  <blockquote>
    <p>System.FormatException: Input string was not in a correct format.</p>
  </blockquote>
  
  <p>But this works in Xaml:</p>
  
  <pre><code> &lt;Label Text="{Binding StartTime, StringFormat='{}{0:hh\\:mm}'}}"/&gt;
  </code></pre>
  
  <p>How do I use string format on a binding for <code>TimeSpan</code> in Xamarin.Forms?</p>