michaellperry / Assisticant

MIT License
36 stars 19 forks source link

Added support for IList to allow UI change the binding source :-) #30

Closed smasihemami closed 4 years ago

smasihemami commented 4 years ago

which is the case when using CheckedComboBox from Xceed WPF Toolkit)

smasihemami commented 4 years ago

There is one thing I was not sure about. On what to change in ListSlot.SetValue. But at least it worked to my expectations w.r.t CheckedComboBox.

michaellperry commented 4 years ago

Looks fantastic. I'll get a new build published. Thank you so much!

smasihemami commented 4 years ago

Thanks a lot Michael. Highly appreciate it :-)

smasihemami commented 4 years ago

On adding/removing items to an ObservableList, it seems to cast items to PlatformProxy which leads to InvalidCastException if the item type is not a primitive type. Do you have a guess on possible workarounds Michael?

michaellperry commented 4 years ago

I had not tested that scenario. That is the purpose of the call to WrapValue in PublishChanges. It is also the reason for TranslateIncomingList unwrapping the values.

I think that the same UnwrapValue call needs to appear in calls to Add and Remove in response to collection changed events. I expect that the control will take an item from the ItemsSource list and add it to the SelectedItemsOverride list. The item will be an instance of a platform proxy if the source item is an object as opposed to a primitive.

Please give this change a try. If it looks promising, I can give you access to the private NuGet repository so that you can test the fix before I push it up to nuget.org.