HichemSeeSharp
HichemSeeSharp

Reputation: 3318

Binding SelectedItems to a ObservableCollection property

Why the SelectedItems can't be bound from XAML ?!..how can I bind it keeping MVVM pattern applied ?

Upvotes: 3

Views: 2705

Answers (2)

SliverNinja - MSFT
SliverNinja - MSFT

Reputation: 31641

SelectedItems is read-only if you are trying to assign in.

If you are trying to read it, MVVM Light has a handy EventToCommand to relay the SelectedItems to your ViewModel

Upvotes: 0

thumbmunkeys
thumbmunkeys

Reputation: 20764

SelectedItems is a read only property it can't be bound to. Although there exist ways around this with attached properties

Upvotes: 2

Related Questions