4
votes

I have a listbox that has its SelectionMode property set to Multiple.

Is it possible to bind the SelectedItem property to a List? and not to a single item?

Thanks

2

2 Answers

5
votes

I've been using Samuel's solution for this and it works very well.

http://blog.functionalfun.net/2009/02/how-to-databind-to-selecteditems.html

1
votes

You can use ListBox.SelectedItems property for this.

    <ListBox x:Name="listBox" SelectionMode="Multiple" ItemsSource="{Binding YourCollection}" />
    <ListBox ItemsSource="{Binding SelectedItems , ElementName=listBox}"/>