I have a list with the following data template:
<DataTemplate x:Name="MyTemplate"> <StackPanel> <TextBlock Name="textblock1" Text="{Binding Name}" /> <TextBlock Name="textblock2" Text="{Binding SurName}" /> <StackPanel Name="extrainfo" Visibility="Collapsed"> <TextBlock Name="textblock3" Text="{Binding Address}" /> <TextBlock Name="textblock4" Text="{Binding Phone}" /> <TextBlock Name="textblock5" Text="{Binding Email}" /> </StackPanel> </StackPanel> </DataTemplate>
List:
<ListBox Name="myListBox" ItemTemplate="{StaticResource MyTemplate}" ItemsSource="{Binding UserList}" />
The problem is this: when the user selects an item in the list, I want to display additional information by setting the visibility of the stack panel to visible.
Any idea how to do this (via xaml or C #)? I tried to change the storyboard, but I'm not very far from this approach.
source share