I'm using DataTemplate for SelectedItem on ListView as :
<ControlTemplate x:Key="SelectedTemplate" TargetType="ListViewItem">
<WrapPanel (...) BackGround="Silver">
</WrapPanel>
(...)
<Style TargetType="ListViewItem">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
<Condition Property="Selector.IsSelectionActive" Value="true" />
</MultiTrigger.Conditions>
<Setter Property="Template" Value="{StaticResource SelectedTemplate}" />
</MultiTrigger>
</Style.Triggers>
</Style>
</ControlTemplate>
Also, ItemsSource is binded to IObservableCollection. But I'm having some problems with selecting item in myListView. What I want to reach is that, Default item template have white background. Selected background is Silver. When I click on item, background changes. But when I'm doing it from code, listview have selected item (checked that, selected index = 0, selectetitem != null), but item get style from non-selected item. So basically I'd like to select item with selectedTemplate. I've tried myListView.SelectedIndex, myLisview.SelectedItem, but doesn't really work.. Any ideas?
Thanks!