Binding SelectedItems to a ObservableCollection pr

2019-02-25 12:01发布

问题:

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

回答1:

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



回答2:

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