title: WPF Design time support for list with custom objects
body: <p>I am making a user control that is a listview with button in it. 
  the buttons have an text and an image. </p>
  
  <p>the listview is bound to an observablecollection of MyType. Adding items to the list and so on works fine and is visible when i run the application. But i also want to have design time support for these properties.</p>
  
  <p>What am i doing wrong? thanks for your help.</p>
  
  <p><strong>usercontrol.xaml</strong></p>
  
  <pre><code>&lt;ListView HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding Items}" BorderBrush="{x:Null}" &gt;
                  &lt;ListView.ItemTemplate&gt;
                      &lt;DataTemplate DataType="client:MyItem"&gt;
                          &lt;StackPanel&gt;
                              &lt;Button  HorizontalContentAlignment="Left" &gt;
                                  &lt;StackPanel&gt;
                                      &lt;TextBlock Text="{Binding Path=ButtonText}" /&gt;
                                      &lt;Image Source="{Binding Path=ImagePath}"&gt;&lt;/Image&gt;
                                  &lt;/StackPanel&gt;
                                  &lt;/Button&gt;
                          &lt;/StackPanel&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ListView.ItemTemplate&gt;
              &lt;/ListView&gt;
  </code></pre>
  
  <p><strong>usercontrol.cs</strong></p>
  
  <pre><code> public UserControl1()
      {
          InitializeComponent();
          this.DataContext = this;
  
      }
  
  public partial class UserControl1 : UserControl
  {
      private ObservableCollection&lt;MyItem&gt; _items = new ObservableCollection&lt;MyItem&gt;();
  
  
      [Description("Items in sidebar")]
      [Category("Data")]
      [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
      public ObservableCollection&lt;MyItem&gt; Items
      {
          get { return _items; }
      }
  }
  </code></pre>
  
  <p><strong>MyItem.cs</strong></p>
  
  <pre><code>[Serializable()]
  public  class MyItem 
  {
  
     public string ButtonText { get; set; }
     public ImageSource Imagepath { get; set; }
  
  }
  </code></pre>
  
  <p><strong>Usage of the user control</strong></p>
  
  <pre><code> &lt;my:UserControl1&gt;
                  &lt;my:UserControl1.Items&gt;
                      &lt;my:MyItem ButtonText="test" Imagepath="../img.png" /&gt;
                      &lt;my:MyItem ButtonText="test2" Imagepath="../img2.png" /&gt;
                  &lt;/my:UserControl1.Items&gt;
              &lt;/my:UserControl1&gt;
  </code></pre>