title: WPF: Expander binding in Listview
body: <p>I want to ListView with expander including some of information. So, I made this code. I'm not sure binding expander like that is correct. I just try to Binding like ListViewItem, But when I try to expander is not work at all. Here is my code.</p>
  
  <p>XAML :<br>
      </p>
  
  <pre><code>    &lt;Grid Grid.Row="2"&gt;
          &lt;ListView x:Name="lv"&gt;
              &lt;ListView.Template&gt;
                  &lt;ControlTemplate&gt;
                      &lt;HeaderedItemsControl&gt;
                          &lt;ItemsPresenter/&gt;
                      &lt;/HeaderedItemsControl&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/ListView.Template&gt;
  
              &lt;ListView.ItemTemplate&gt;
                  &lt;DataTemplate DataType="{x:Type local:LogBase}"&gt;
                      &lt;Expander Grid.Column="0" HorizontalAlignment="Center"&gt;
                          &lt;Expander.HeaderTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;StackPanel Orientation="Horizontal"&gt; &lt;!-- why this code is not wokring...? --&gt;
                                      &lt;TextBlock Text="{Binding No}"/&gt;
                                      &lt;TextBlock Text="{Binding Timestamp}"/&gt;
                                      &lt;TextBlock Text="{Binding Type}"/&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/Expander.HeaderTemplate&gt;
                      &lt;/Expander&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListView.ItemTemplate&gt;
          &lt;/ListView&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>code behind : </p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public List&lt;LogBase&gt; logs { get; set; }
  
      public MainWindow()
      {
          InitializeComponent();
  
          logs = new List&lt;LogBase&gt;();
  
          logs.Add(new LogBase()
          {
              No = "1",
              Timestamp = "123456789",
              Type = "Tcp"
          });
  
          logs.Add(new LogBase()
          {
              No = "2",
              Timestamp = "123456789",
              Type = "Tcp"
          });
  
          logs.Add(new LogBase()
          {
              No = "3",
              Timestamp = "123456789",
              Type = "Tcp"
          });
  
  
          lv.ItemsSource = logs;
  
          DataContext = this;
      }
  
  }
  
  public class LogBase
  {
      public string No { get; set; }
      public string Timestamp { get; set; }
      public string Type { get; set; }
  }
  </code></pre>
  
  <p>for better understanding I captured what I want to</p>
  
  <p><a href="https://i.stack.imgur.com/LmS3T.png" rel="nofollow noreferrer">Now my program's situation</a></p>
  
  <p>If you have any of opinions please comment for me!</p>