How to set DataContext to ListView ItemTemplate?
You can set DataType
property of DataTemplate
to ElementType
.
<ListView>
<ListView.ItemTemplate>
<DataTemplate DataType="{x:Type local:ElementType}">
...
</DataTemplate>
</ListView.ItemTemplate>
</ListView>