title: WPF Listview Item Vertical Positioning with Canvas Overlap Issue
body: <p>I have a word addin which has a <strong>WPF</strong> custom task pane. In that I have a <code>Listview</code>. I need to dynamicaly update the position of each <code>listview</code> item when word document scroll down. but some of them can be having same <code>canvas.top(vertical Y)</code> value.Then those items getting overlap.</p>
  
  <p>I do not need to overlap those,I need as listview need to align one after another.</p>
  
  <p><a href="http://i.stack.imgur.com/3ZEwR.png" rel="nofollow">screen sample</a></p>
  
  <p>Code Sample XAML..</p>
  
  <pre><code>&lt;listViewTool:ListView x:Name="Results" Margin="0" BorderThickness="0" DockPanel.Dock="Top" Background="WhiteSmoke"
                    ScrollViewer.HorizontalScrollBarVisibility="Disabled"                      
                    ItemsSource="{Binding Results}"
                    SelectionMode="Single"&gt;
      &lt;listViewTool:ListView.ItemContainerStyle&gt;
          &lt;Style TargetType="ListViewItem"&gt;
              &lt;Setter Property="Control.HorizontalContentAlignment" Value="Stretch"/&gt;
              &lt;Setter Property="Control.Margin" Value="0"/&gt;
              &lt;Setter Property="Control.Padding" Value="0"/&gt;
              &lt;Setter Property="Control.BorderThickness" Value="0"/&gt;
              &lt;Setter Property="IsSelected" Value="{Binding Path=Selected, Mode=TwoWay}"/&gt;
              &lt;Setter Property="Canvas.Top" Value="{Binding Y}"/&gt;
              &lt;Setter Property="Canvas.Left" Value="0"/&gt;
              &lt;Setter Property="Canvas.Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListView}},Path=ActualWidth}" /&gt;
          &lt;/Style&gt;
      &lt;/listViewTool:ListView.ItemContainerStyle&gt;
      &lt;listViewTool:ListView.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;Canvas x:Name="CanvasMain" HorizontalAlignment="Stretch" Height="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListView}},Path=ActuaHeight}"
                              ClipToBounds="True" /&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/listViewTool:ListView.ItemsPanel&gt;
  &lt;/listViewTool:ListView&gt;
  </code></pre>
  
  <p>Thanks.</p>