title: Bind dataTemplate to external Data Source
body: <p>i have this DataTemplate:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:Model="clr-namespace:Effectus.Model"
  xmlns:Controls="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
  &gt;
  
  &lt;DataTemplate DataType="{x:Type Model:ToDoAction}"&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto" /&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="*"/&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="Auto"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition/&gt;
              &lt;ColumnDefinition/&gt;
          &lt;/Grid.ColumnDefinitions&gt;
  
          &lt;TextBlock Text="Title" 
                     Grid.Row="0" Grid.Column="0"/&gt;
          &lt;TextBox Text="{Binding Path=Title}"
                     IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}},Path=DataContext.AllowEditing.Value}"
                     Grid.Row="0" Grid.Column="1"/&gt;
  
          &lt;TextBlock Text="Content" 
                     Grid.Row="1" Grid.Column="0"/&gt;
          &lt;TextBox Text="{Binding Path=Content}"
              IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}},Path=DataContext.AllowEditing.Value}"
              AcceptsReturn="True"
              MinHeight="100"
              Grid.Row="2" Grid.ColumnSpan="2"/&gt;
  
          &lt;TextBlock Text="Owner"
                     Grid.Row="6" Grid.Column="0"/&gt;
          &lt;ComboBox SelectedItem="{Binding Path=Owner}" DisplayMemberPath="Username" SelectedValuePath="Username"
                    ItemsSource="{Binding Converter={StaticResource EnumValuesConverter}, ConverterParameter={x:Type Model:Status}}"
                    IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}},Path=DataContext.AllowEditing.Value}"
                    Grid.Row="6" Grid.Column="1"/&gt;
  
      &lt;/Grid&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the last part you can see a TextBlock whose Text is "Owner", followed by a ComboBox.
  Just to give you the context, this is a little part of a ToDo app that i'm currently working on (i'm trying to get into MVVM).
  The XAML i poted is the DataTemplate of the ToDoAction objects.
  I want the "Owner" ComboBox to be filled by all users. I can get them from DB through NHibernate but i don't have the faintest idea on how to bind the DataTemplate to my DataSource (a Nhibernate Session in my case, but i feel this is more general).
  Can you give some little advise please?
  Thank you all very much!</p>