title: WPF Listview binding userControl property
body: <p>I'm new at <code>WPF</code>. I have <code>Listview</code>, and i want to display more than <code>usercontrol</code> at it.</p>
  
  <p>I used ItemTemplate.</p>
  
  <p><strong>Listview like this:</strong></p>
  
  <pre><code>    &lt;ListView HorizontalAlignment="Stretch" Margin="0,40,0,0" Name="listView1" VerticalAlignment="Stretch"
                ItemTemplate="{StaticResource DriveUserControlDataTemplate}" &gt;
          &lt;ListView.ItemsPanel&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                                 ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
                                 MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
                                 ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" /&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/ListView.ItemsPanel&gt;
      &lt;/ListView&gt;
  
  
      &lt;DataTemplate x:Key="DriveUserControlDataTemplate" &gt;
          &lt;StackPanel Margin="10"&gt;
              &lt;c:DriveUserControl Drive="{Binding Name}" EventAdd="DriveUserControlAdd_Click"&gt;
              &lt;/c:DriveUserControl &gt;
          &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>and i want to bind usercontrols by this code:</p>
  
  <pre><code> listView1.ItemsSource = DriveInfo.GetDrives()
                  .Where(item =&gt; item.IsReady &amp;&amp; item.DriveType == DriveType.Removable)
                  .ToList();
  </code></pre>
  
  <p>Class <code>DriveInfo</code> has property named <code>Name</code></p>
  
  <p>Any one tell me why it didn't bind?</p>