This question is locked. New answers and comments are not allowed.
What's the proper way to do this? I see two MVVM-friendly ways of doing this in other XAML platforms (i.e. Silverlight & WPF) on the internet:
1. Change the ItemContainerStyle:
2. Create a custom Behavior.
Of course, I can't get the 1st option to work in RT. I don't know why.
And RT doesn't support Behaviors.
Has anyone else done this or tried to? I'd really not like to have to build some two-way synchronization code in the code-behind.
I understand that it's the established standard to make the SelectedItems property in a List control without a Setter, but, at this time I'd like to slap the person who decided that was a good idea (yes, I know it's an ObservableCollection & that would mess up the CollectionChanged event wirings -- but without being able to bind to the property, what's the point?).
1. Change the ItemContainerStyle:
<GridView.ItemContainerStyle> <Style TargetType="GridViewItem"> <Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}" /> </Style></GridView.ItemContainerStyle>2. Create a custom Behavior.
Of course, I can't get the 1st option to work in RT. I don't know why.
And RT doesn't support Behaviors.
Has anyone else done this or tried to? I'd really not like to have to build some two-way synchronization code in the code-behind.
I understand that it's the established standard to make the SelectedItems property in a List control without a Setter, but, at this time I'd like to slap the person who decided that was a good idea (yes, I know it's an ObservableCollection & that would mess up the CollectionChanged event wirings -- but without being able to bind to the property, what's the point?).