Tuesday, 10 September 2013

Reset SelectedItem in LongListSelector after selection

Reset SelectedItem in LongListSelector after selection

I'm using Caliburn.Micro and the LongListSelector. Because binding
SelectedItem is a problem I act on the SelectionChanged event. Problem is,
after returning to the list, when I click the same item again, it is
already selected. So the event doesn't fire. I could set the SelectedIndex
to -1 or something, but in Caliburn.Micro I can't access UI controls.
That's the point of MVVM, isn't it?! :)
Here's my XAML
<LongListSelector x:Name="NewsItems"
ItemsSource="{Binding NewsItems}"
cal:Message.Attach="[Event SelectionChanged] =
[NavigateToArticle($eventArgs)]" />
How to solve this? How can I reset the SelectedItem when I can't access
the LongListSelector from code?
Thanks!

No comments:

Post a Comment