title: Why DataGrid doesn't display sample design-time data?
body: <p>I'm trying to load some sample data into my <code>UserControl</code> to work at design time.</p>
  
  <p>It's a Sale that has associated a collection of OrderItems and a Number:</p>
  
  <pre><code>using System;
  using System.Collections.ObjectModel;
  
  namespace MiPaladar.SampleData
  {
      public class SampleSale
      {
          public int Number { get; set; }        
  
          public ObservableCollection&lt;SampleLineItem&gt; OrderItems { get; set; }              
      }
  }
  </code></pre>
  
  <p>The problem is the <code>TextBox</code> bound to the <code>Number</code> property shows it just fine, but the <code>DataGrid</code> bound to the collection of <code>OrderItems</code> is empty, not showing the items. Why not?</p>
  
  <p>This the <code>SampleLineItem</code> class:</p>
  
  <pre><code>namespace MiPaladar.SampleData
  {
      public class SampleLineItem
      {
          public float Quantity { get; set; }
          public float Price { get; set; }
      }
  }
  </code></pre>
  
  <p>And the <code>SampleSaleData.xaml</code>:</p>
  
  <pre><code>&lt;local:SampleSale xmlns:local="clr-namespace:MiPaladar.SampleData" 
                    Number="78" &gt;
      &lt;local:SampleSale.OrderItems&gt;
      &lt;local:SampleLineItem Quantity="1" Price="3.5"/&gt;
      &lt;local:SampleLineItem Quantity="2" Price="7"/&gt;
      &lt;local:SampleLineItem Quantity="1" Price="8"/&gt;
  &lt;/local:SampleSale.OrderItems&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Finally my UserControl:</p>
  
  <pre><code>&lt;UserControl x:Class="MiPaladar.Views.UserControl1"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              
  
           mc:Ignorable="d" 
  
           d:DesignHeight="300" d:DesignWidth="300" &gt;
  
  &lt;Grid d:DataContext="{d:DesignData /SampleData/SampleSaleData.xaml}"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto"/&gt;
          &lt;RowDefinition/&gt;            
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;StackPanel Orientation="Horizontal"&gt;
          &lt;TextBlock Text="Order Number:"  Margin="5"/&gt;
          &lt;TextBox Margin="5" Text="{Binding Number}"/&gt;
      &lt;/StackPanel&gt;        
  
      &lt;!--Orderitems--&gt;
      &lt;DataGrid AutoGenerateColumns="False" ItemsSource="{Binding OrderItems}"
                Grid.Row="1" Margin="5" &gt;
  
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Header="Quantity" Binding="{Binding Quantity}" /&gt;
  
              &lt;DataGridTextColumn Header="Price" Binding="{Binding Price, StringFormat=c}" /&gt;
  
          &lt;/DataGrid.Columns&gt;
      &lt;/DataGrid&gt;        
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Thanks in advanced!</p>