title: C# / WPF - DesignData - Binding to DesignData Collection Properties
body: <p>I like design time data, especially when creating small widgets. For this very simple use case I'm having trouble binding to the properties of a design-time list which I have created in xaml.</p>
  
  <p>Please find my ViewModel, View and SampleData below;</p>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>internal class SummaryViewModel : ViewModelBase
  {
      public string Title { get; set; }
  
      public IList&lt;Person&gt; PersonList { get; set; }
  
      internal SummaryViewModel()
      {
          PersonList = new List&lt;Person&gt;();
      }
  }
  </code></pre>
  
  <p><strong>Sample Data</strong></p>
  
  <pre><code>&lt;ViewModel:SummaryViewModel xmlns:ViewModel="ViewModel" Title="Test Title"&gt;
      &lt;ViewModel:SummaryViewModel.Connections&gt;
          &lt;ViewModel:ConnectionViewModel Id="0" /&gt;
          &lt;ViewModel:ConnectionViewModel Id="1" /&gt;
      &lt;/ViewModel:SummaryViewModel.Connections&gt; 
  &lt;/ViewModel:SummaryViewModel&gt;
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;StackPanel x:Class="View.SummaryView"
              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="100" 
              d:DesignWidth="100"
              d:DataContext="{d:DesignData Source=/DesignData/SampleSummaryViewModel.xaml}"
  
              Orientation="Vertical"
              Background="LightGreen"&gt;
  
      &lt;!-- This Works --&gt;
      &lt;Label FontSize="10" FontWeight="Bold" Content="{Binding Title}" /&gt;
  
      &lt;!-- This Works --&gt;
      &lt;ListBox ItemsSource="{Binding PersonList}" /&gt;
  
      &lt;!-- This DOESN'T work --&gt;
      &lt;Label FontSize="8" Content="{Binding PersonList, Path=Count}"/&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p><strong>How would you configure SampleData such that you could bind to the Count of a list specified therein?</strong></p>
  
  <p>I have tried setting the resource type as both <code>DesignData</code> and <code>DesignDataWithDesignTimeCreatableTypes</code> with no luck.</p>