In IObservableListBind{TItemA,TItemB}, IObservablePropertyBinder add a user definable exception handling routine that is called if an exception occurs when synchronizing and a dirty flag for when a synchronization did not complete successfully.
This would replace the need for the following if exceptions are expected during synchronization:
try{//need for every Add
listA.Add(item);
catch Exception(){if(listA.Count != listB.Count) listA.List.Remove(item);}
with something like this:
obvListBind.SyncExceptionHandler +=(sourceList,targetList,eventArgs)=>{//Only defined onceif(!obvListBind.IsDirty)return;if(eventArgs.Action == NotifyCollectionChangedAction.Add) sourceList.List.RemoveAt(eventArgs.NewStartingIndex);// ... other events
When using the IList.IndexOf(Object) method on ObservableList<T> with an incompatible type, an exception is thrown. This happens when using the observable list as ItemsSource for a WinUI TabView control
The List<T> implementation checks for type compatibility and returns -1 in case the type is not castable to the generic type parameter T - see the reference source
Since in the above mentioned scenario the calls to ObservableList<T> can't be changed, and this terminates the app, I would appreciate it if this could be fixed