Giter Club home page Giter Club logo

gstc.collections.observablelists's People

Contributors

dependabot[bot] avatar gsonnenf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jmkinzer

gstc.collections.observablelists's Issues

ObservableList<T> does not implement IReadOnlyList<T>

ObservableList<T> derives from AbstractUpcastList<T>, which implements IList<T>, but does not implement IReadOnlyList<T>.

I think this fix should be trivial as IReadOnlyList<T> is actually a subset of IList<T>. Can you please implement this small fix?

Feature: ObservableListBind/Property - Add a user definable exception handling routine that is called if an exception occurs when synchronizing.

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 once
if (!obvListBind.IsDirty) return;
if (eventArgs.Action == NotifyCollectionChangedAction.Add)  sourceList.List.RemoveAt(eventArgs.NewStartingIndex);
// ... other events

ObservableList throws when using IndexOf(object) with incompatible type

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.