The way I do it usually is I do a TwoWay
binding of the SelectedItem
property on the list control with a similarly named property on the view model and once I have that - my selected item view can bind to the view model. Of course you can bind directly from the selected item view to the list control's SelectedItem
and further on to the properties of the item properties using ElementName
binding, but that misses the point of separation of concerns.
Example for the dirty approach:
<ListView
x:Name="lv">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Property1}" />
<TextBlock Text="{Binding Property2}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView
<Grid
x:Name="SelectedItemView">
<TextBlock Text="{Binding SelectedItem.Property1, ElementName='lv'}" />
</Grid>