问题
I have an issue with multiple listviews.
I want them to have shared selection and SelectionMode=Extended
I managed to find a solution if SelectionMode=Single
but it doesn't work for Extended situation
Basicly my code looks like this
<ItemsControl ItemsSource="{Binding Items}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<ListView
SelectionMode="Extended" ItemsSource="{Binding items2}"
ItemTemplate="{StaticResource BubbleTemplate}"
SelectedValue="{Binding DataContext.SelectedValue,
RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type ItemsControl}}}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
It supports some kind of shared selection, so if i select item in one list view, items in other list view automatically deselect. But if i try to select multiple elements with Ctrl pressed it works only inside single list view.
Do you have any ideas how to solve this?
Thanks
来源:https://stackoverflow.com/questions/59991712/wpf-multiple-listviews-with-shared-selection-mvvm