Binding to design data in WPF
<p>I have a WPF window containing a ListBox. The ItemsSource is bound to a property of a view model.</p>

<pre><code>&lt;Window x:Class="SimpleWpfApp.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525"
        DataContext="{Binding MainWindowViewModel, Source={StaticResource Locator}}"&gt;
  &lt;DockPanel&gt;
    &lt;ListBox ItemsSource="{Binding SomeThings}" /&gt;
  &lt;/DockPanel&gt;
&lt;/Window&gt;
</code></pre>

<p>The property of the view model is an observable collection of a custom interface; ISomeInterface. The interface is very simple and is implemented by SomeClass which additionally overrides ToString.</p>

<pre><code>public class MainWindowViewModel
{
  public ObservableCollection&lt;ISomeInterface&gt; SomeThings
  {
    get
    {
      var list = new List&lt;ISomeInterface&gt;
      {
        new SomeClass {Value = "initialised"},
        new SomeClass {Value = "in"},
        new SomeClass {Value = "code"}
      };

      return new ObservableCollection&lt;ISomeInterface&gt;(list);
    }
  }
}

public interface ISomeInterface
{
  string Value { get; }
}

public class SomeClass : ISomeInterface
{
  public string Value { get; set; }

  public override string ToString() =&gt; Value;
}
</code></pre>

<p>When I view the window in Visual Studio 2015 or Blend all is as expected. ToString is called and the ListBox populated.</p>

<p><a href="http://i.stack.imgur.com/E9Mep.png" rel="nofollow">Blend screenshot</a></p>

<p>I have created XAML design data which I want to use when in design mode. I have added the design data in a directory called SampleData. I add a design datacontext statement to the window XAML immediately below the first DataContext.</p>

<pre><code>d:DataContext="{d:DesignData Source=/SampleData/Data.xaml}"
</code></pre>

<p>This doesn't work. Visual Studio and Blend report 'File or project item not found' regardless of what I use for source path. I have tried /SampleData/Data.xaml,  SampleData/Data.xaml, ../SampleData/Data.xaml, ./../SampleData/Data.xaml</p>

<p>Visual Studio and Blend only find Data.xaml if I move it out of the SampleData directory and into the project root. Then I am able to reference it using source path /Data.xaml or Data.xaml. If I use Data.xaml without prefixing / then Visual Studio and Blend report that the file cannot be found.. but find it anyway.</p>

<p>My first question is .. Can I use sample data in a sub-directory? And if so how?</p>

<p>Having successfully referenced Data.xaml in the project root, my window is not calling the overridden ToString so I'm getting a list of class name displayed. The list has the same number of items as the design data so it appears it is using the design data.</p>

<p>My second question is .. Why is the overridden ToString not being called here when it is if the objects are instantiated from code?</p>

<p>I'm aware I can achieve the desired result by specifying an item template.</p>

<pre><code>&lt;ListBox ItemsSource="{Binding SomeThings}"&gt;
  &lt;ListBox.ItemTemplate&gt;
    &lt;DataTemplate&gt;
      &lt;TextBlock Text="{Binding Value}"/&gt;
    &lt;/DataTemplate&gt;
  &lt;/ListBox.ItemTemplate&gt;
&lt;/ListBox&gt;
</code></pre>

<p>Full source is available for the example application on github</p>

<p><a href="https://github.com/DangerousDarlow/WpfDesignData" rel="nofollow">https://github.com/DangerousDarlow/WpfDesignData</a></p>

<p>UPDATE</p>

<p>Thanks to jstreet for answering. I changed the file properties for data.xaml in the sub directory and am now able to use this as design data. I thought I'd tried this before but I must be mistaken.</p>

<p>I'm still not seeing ToString being called. I tried changing the view model property to <code>List&lt;object&gt;</code> and also <code>List&lt;ISomeInterface&gt;</code> but both resulted in called to object.ToString; deduced by the display of the class name. I'll probably stop looking at this point as I'm not going to be using ToString anyway, I'll bind to the properties I want to display. It would be good to explain the difference in behaviour though.</p>

<p>I'm using Visual Studio 2015 community edition.</p>