title: WPF Display fake Data in designer with Collection of Interface
body: <p>I want display fake data in Visual Studio Designer. I use View Service Interface way with this aborecence (it is minimal example) :</p>
  
  <pre><code>-ServiceView
    -IMainWindow.cs
    -ICustomer.cs
  -SampleData
    -MainWindowDesign.cs
    -CustomerDesign.cs
    -Data.xaml
  </code></pre>
  
  <p>IMainWindow.cs</p>
  
  <pre><code>namespace TestDesignSampleData.ServiceView
  {
      interface IMainWindow
      {
          ObservableCollection&lt;ICustomer&gt; Customers { get; }
      }
  }
  </code></pre>
  
  <p>ICustomer.cs</p>
  
  <pre><code>namespace TestDesignSampleData.ServiceView
  {
      interface ICustomer
      {
          string Name { get; set; }
      }
  }
  </code></pre>
  
  <p>MainWindowDesign.cs</p>
  
  <pre><code>namespace TestDesignSampleData.SampleData
  {
      class MainWindowDesign : IMainWindow
      {
          public ObservableCollection&lt;ICustomer&gt; Customers { get; set; }
  
          public MainWindowDesign()
          {
          //Customers = new ObservableCollection&lt;ICustomer&gt;();
          }
      }
  }
  </code></pre>
  
  <p>CustomerDesign.cs</p>
  
  <pre><code>namespace TestDesignSampleData.SampleData
  {
      class CustomerDesign : ICustomer
      {
          public string Name { get; set; }
      }
  }
  </code></pre>
  
  <p>Data.xaml</p>
  
  <pre><code>&lt;sd:MainWindowDesign xmlns:sd="clr-namespace:TestDesignSampleData.SampleData"&gt;
      &lt;sd:MainWindowDesign.Customers&gt;
          &lt;sd:CustomerDesign Name="Charly Sparow"/&gt;
          &lt;sd:CustomerDesign Name="Jacky Chan"/&gt;
          &lt;sd:CustomerDesign Name="Dora Exploring"/&gt;
      &lt;/sd:MainWindowDesign.Customers&gt;
  &lt;/sd:MainWindowDesign&gt;
  </code></pre>
  
  <p>This can build and execute, but the data are not displayed and the designer send this error for each line of the collection in Data.xaml :</p>
  
  <pre><code>Error 1 The specified value cannot be assigned to the collection. 
  The following type was expected: "ICustomer".
  </code></pre>
  
  <p>For some reason, Customer Design is not recognized as ICustomer.</p>
  
  <p>EDIT:
  I think it is Visual Studio designer bug. I dont have this problem with Blend. Maybe the Blend designer's compiler is more advanced.</p>
  
  <p>Minimal Project to reproduce the error :</p>
  
  <p><a href="https://github.com/Orwel/DesignerError/releases/tag/CompiledProject" rel="nofollow">https://github.com/Orwel/DesignerError/releases/tag/CompiledProject</a></p>