In a Silverlight app from Windows Phone 7, I have this ListBox:
<ListBox ItemsSource="{Binding Path=Programs}" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Begin, Converter={StaticResource TimeOfDayConverter}}" Margin="0,0,10,0" Width="46" /> <TextBlock Text="{Binding Title}" FontSize="30" /> </StackPanel> <TextBlock x:Name="txtDescription" Text="{Binding Description}" Margin="56,0" Visibility="Collapsed" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate>
I need the TextBlock named txtDescription collapse by default, but set it visible when the item is selected. How can I do this (preferably in XAML)?
driis source share