title: Is it possible to display data at design time in a treeview that uses binding at runtime?
body: <p>Is it possible to display something in my treeview at design time and what would be the best way to achieve it?</p>
  
  <p>Runtime works perfectly well and does display the data I want. However, I would like to have a more convenient display when designing than an empty area where the treeview is.</p>
  
  <p>Thank you.</p>
  
  <p>The treeview looks like this: </p>
  
  <pre><code>       &lt;TreeView x:Name="tvConfig" Width="400" Height="300"  &gt;
  
          &lt;TreeView.ItemTemplate&gt;
  
              &lt;HierarchicalDataTemplate DataType="{x:Type demo:TvItemsSource}" ItemsSource="{Binding Path=Items}"&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;Image&gt;&lt;/Image&gt;
                      &lt;TextBlock Text="{Binding Name}"&gt;&lt;/TextBlock&gt;
                  &lt;/StackPanel&gt;
  
              &lt;/HierarchicalDataTemplate&gt;
          &lt;/TreeView.ItemTemplate&gt;
      &lt;/TreeView&gt;
  </code></pre>
  
  <p>And make uses of this class: </p>
  
  <pre><code>Public Class TvItemsSource
   Public Property Items() As New List(Of TvItemsSource)
   Public Property Name() As String
  
   Public Sub New(Name As String)
      Me.Name = Name
   End Sub
  
  End Class
  </code></pre>
  
  <p>I generated a small runtime data using the following piece of code: </p>
  
  <pre><code>Private _source As TvItemsSource
  Private Sub LoadData()
    _source = New TvItemsSource("Root")
    _source.Items.Add(New TvItemsSource("Item 1"))
    _source.Items.Add(New TvItemsSource("Item 2 "))
      Dim ParentItem1 = New TvItemsSource("Parent 1")
      ParentItem1.Items.Add(New TvItemsSource("Enfant 1"))
      Dim ParentItem2 = New TvItemsSource("Parent 2")
      ParentItem2.Items.Add(New TvItemsSource("Enfant 2"))
      ParentItem1.Items.Add(ParentItem2)
      _source.Items.Add(ParentItem1)
  
      tvConfig.ItemsSource = _source.Items
  End sub
  </code></pre>
  
  <p>edit: In the xaml of the treeview, I added the xmlns namespace of the application to declare the data type as :</p>
  
  <pre><code>xmlns:demo="clr-namespace:demo"
  </code></pre>