title: Binding DateTime to TimePicker in Xamarin Forms
body: <p>I tried to bind a DateTime value to a TimePicker instead of a TimeSpan.
  If I change the Datatype then I have to change my complete code.</p>
  
  <p>The property is called Item.Time</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" Title="New Item"&gt;
      &lt;ContentPage.ToolbarItems&gt;
          &lt;ToolbarItem Text="Save" Clicked="Save_Clicked" /&gt;
      &lt;/ContentPage.ToolbarItems&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout Spacing="20" Padding="15"&gt;
              &lt;Label Text="Text" FontSize="Medium" /&gt;
              &lt;TimePicker Time="{Binding Item.Time}"/&gt;
              &lt;Label Text="Description" FontSize="Medium" /&gt;
              &lt;Editor Text="{Binding Item.Text}" FontSize="Small" Margin="0" /&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>How can I convert DateTime to TimeSpan without using an other class or something like that?</p>
  
  <p>Is it possible to convert it with code like this:</p>
  
  <pre><code>&lt;TimePicker Time="{Binding **(TimeSpan)**Item.Time}"/&gt;
  </code></pre>