c# - Binding ObservableCollection to selected items of a ListBox -
after hours , hours of googling, still can't find simple solution binding observablecollection selected items of listbox in twoway mode...
what have simple : listbox selectionmode="multiple", , observablecollection<contact> named selectedcontacts. want 2 bound. of course listbox has itemssource="{binding contacts}" observablecollection of contact.
now can't use isselected bool on contact items, can't.
thank !
there is no simple solution. can't bind selecteditems.
the best solution select contact items view model object isselected property, bind that, , run query against primary oc when need selected items collection.
since said can't/won't that, next best solution handle selectionchanged in code-behind , manually update vm collection there.
Comments
Post a Comment