Hello,
i have a ListView which contains objects bound from an collection. The representation of the objects i have set with data-template. Now i want to do the following. There are two TextBlocks in my DataTemplate:
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}"></TextBlock>
<TextBlock Text="{Binding Path}"></TextBlock>
</StackPanel>
</DataTemplate>
I already have specified an ItemContainerStyle which I use to realize a hover-effect.
<Style TargetType="ListViewItem" x:Key="ContainerStyle">
<Style.Triggers>
<EventTrigger RoutedEvent="Mouse.MouseEnter">
... and so on
My aim is to underline the TextBlock which contains the Name, when user moves mouse over the ListViewItem. The Path shouldn't be underlined. How can this be realized? How can an element in DataTemplate can be accessed for each ListViewItem?
Greetings, Martin