How is it possible to highlight the selected item in the new LongListSelector on Windows Phone 8? Actually nothing happend if I tapped one entry of the list. My list only contains a simple string which will be displayed through a TextBlock. But I want to highlight the selection of the user.
Thanks.
In my case I used a RadioButton
Control in the DataTemplate
of the LongListSelectorItem
to achieve this. You will have a checked oder unchecked sign at the left border.
In any case it is important, that you set the same group for all Radiobuttons, so the selection only represents one entry.
Inside the Content
or your RadioButton
you can put the TextBlock
bound to the String
.
Im currently not at home, but if this wont solve your problem, I'll provide you some code when I'm at home ;)
Here you go:
<LongListSelector.ItemTemplate>
<DataTemplate>
<ContentControl HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
<RadioButton HorizontalAlignment="Stretch" Margin="0,0,0,0" GroupName="A" Background="Black" >
<StackPanel toolkit:TiltEffect.IsTiltEnabled="True">
<TextBlock Text="{Binding Path=XXX}"
TextWrapping="Wrap"
Foreground="Black"
Style="{StaticResource PhoneTextExtraLargeStyle}"/>
<TextBlock Text="{Binding Path=XXXX}"
TextWrapping="Wrap"
Foreground="Black"
Margin="14,-6,0,0"
Style="{StaticResource PhoneTextSubtleStyle}"/>
</StackPanel>
</RadioButton>
</ContentControl>
</DataTemplate>
</LongListSelector.ItemTemplate>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With