title: WPF Binding: How to databind to Grid?
body: <p>I have created a class <code>Account</code>.<br>
  Next, I have created another class <code>ReorderWindowController</code> which has a field/property <code>SelectedAccount</code> of type <code>Account</code>.  </p>
  
  <p>Finally, I have written <code>ReorderWindow</code> WPF window xaml file:</p>
  
  <pre><code>&lt;Window ...
  
      &lt;Window.Resources&gt;
  
          &lt;contollers:ReorderWindowController x:Key="WindowController" /&gt;
  
          &lt;DataTemplate DataType="{x:Type entities:Account}"&gt;
              &lt;Grid Width="140" Height="50" Margin="5"&gt;
                  &lt;TextBlock Text="Some awesome text" /&gt;
                  &lt;TextBlock Text="{Binding Name}" /&gt;
                  &lt;TextBlock Text="Even more awesome text" /&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
  
      &lt;/Window.Resources&gt;
  
      &lt;Grid&gt;
          &lt;Grid 
              Name="AccountGrid" 
              DataContext="{Binding Source={StaticResource ResourceKey=WindowController},
                            Path=SelectedAccount}"&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  
  &lt;/Window&gt;
  </code></pre>
  
  <p>When I run my code, <code>AccountGrid</code> is not showing anything. Why? How do I make object data bind to the <code>Grid</code> and how do I make it use my data template? Thanks. </p>