1

i have a UserControl as DataTemplate for my ListView with dependency property.

page1.Xaml

<!-- ListView -->
<ListView  ItemSource="{x:bind ViewModel.Profils}" SelectionMode="Single" SelectedItem="x:bind ViewModel.SelectedProfil, Mode="TwoWay", Converter={}}">

    <ListView.ItemTemplate>
        <DataTemplate x:DataType="vm:AbstractProfilVM">
            <!-- Master -->
            <widget:CelProfilMaster CelProfilMasterName={x:Bind Name} CelProfilMasterAge={x:Bind Age} ... />
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

<!-- Details -->
<widget:CelDetail CelProfilDetailsName="{x:bind ViewModel.SelectedProfil.Name}..."/>

It work well, but how change the background of my UserControl when he is selected in the listView?

sasukaru
  • 98
  • 1
  • 16
  • Possible duplicate of [How to identify which element was double clicked inside a ListBox?](http://stackoverflow.com/questions/37404061/how-to-identify-which-element-was-double-clicked-inside-a-listbox) – Salah Akbari Jul 26 '16 at 08:04

1 Answers1

0

You should override the ListView style and change the Selected VisualState

  • Thanks for your answer, But how targeted my UserControl CelProfilMaster? Can I define the style and target him like ? – sasukaru Jul 26 '16 at 20:25