<commit_before># ObservableLinq


ObservableLinq is an open source, portable class library that can be easily deployed from [nuget] and used in .NET 4.5, Windows Phone 8 and Windows Store applications. ObservableLinq proposes to implement a subset of the [LINQ] operators on ObservableCollection, where source collection changes are automatically reflected in the result collection.

![a](https://raw.github.com/TheFabFab/ObservableLinq/master/img/basic_projection.gif)

## How would you use ObservableLinq?

### Project data between different domains

Larger applications are often architectured in a layered manner (3-tier application, MVVM, etc.) The different domains can add new attributes, filters and sort criteria to your data.

Consider an editable data grid that contains personal data in an MVVM application. The model class will contain records with first name, last name, etc. Your view model might wrap the model object and have additional attributes, like 'IsEditing' and 'IsChanged'. Your UI layer will transform the view model into rows in the datagrid.

Using ObservableLinq not only allows you to project your model into view models, but when your original collection changes, it will keep the view model collection up to date, without loosing the added data on the view model level.

### Change between different views of the same collection

ObservableLinq provides a special collection class, called ObserverCollection. This collection can be instructed to follow a different observable collection. However, ObserverCollection can change from one observed collection to another at any time. Items present in both will be retained and moved to their new position.

Let's consider our personal data view models from before. We can project that collection into one where we sort by first name and another one where we sort by last name. Maybe another one, where we filter out unchanged items. Then, we bind our datagrid to an observer collection that switches between these collections according to user input...

### Display all these visually to the user

The basic modification events on the ICollectionChanged interface can be translated into animations like in the figure above, which results in a user interface that is both appealing and gives plenty of visual clues to the user in order to correctly understand the underlying data manipulation.

## Current state

 - "Alpha" state
 - Functioning ObserverCollection
 - Select, Distinct, Where, OrderBy operators *mostly* ready

## License

[Apache License Version 2.0]

## Contributions

Pull requests are welcome. In order to be accepted, the functionality has to be unit tested against the static Linq operators.

[nuget]: https://www.nuget.org/<commit_msg>Update with changes in the article<commit_after># ObservableLinq


ObservableLinq is an open source, portable class library that can be easily deployed from [nuget] and used in .NET 4.5, Windows Phone 8 and Windows Store applications. ObservableLinq proposes to implement a subset of the [LINQ] operators on ObservableCollection, where source collection changes are automatically reflected in the result collection.

![a](https://raw.github.com/TheFabFab/ObservableLinq/master/img/basic_projection.gif)

## How would you use ObservableLinq?

### Project data between different domains

Larger applications are often architectured in multiple layers, across multiple tiers. The different layers can enrich data coming from another layer with new attributes, filters and sort criteria.

Consider an editable data grid that contains personal data in an MVVM application. The model class will contain records with first name, last name, etc. Your view model might wrap the model object and have additional attributes, like 'IsEditing' and 'IsChanged'. Your UI layer will transform the view model into rows in the datagrid.

Using ObservableLinq not only allows you to project your model into view models, but when your original collection changes, it will keep the view model collection up to date, without loosing the added data on the view model level.

### Change between different views of the same collection

ObservableLinq provides a special collection class, called ObserverCollection. This collection can be instructed to follow a different observable collection. However, ObserverCollection can change from one observed collection to another at any time. Items present in both will be retained and moved to their new position.

Let's consider our personal data view models from before. We can project that collection into one where we sort by first name and another one where we sort by last name. Maybe another one, where we filter out unchanged items. Then, we bind our datagrid to an observer collection that switches between these collections according to user input...

### Display changes visually to the user

The basic modification events on the ICollectionChanged interface can be translated into animations like in the figure above, which results in a user interface that is both appealing and gives plenty of visual clues to the user in order to correctly understand the underlying data manipulation.

## Current state

 - "Alpha" state
 - Functioning ObserverCollection
 - Select, Distinct, Where, OrderBy operators *mostly* ready

## License

[Apache License Version 2.0]

## Contributions

Pull requests are welcome. In order to be accepted, the functionality has to be unit tested against the static Linq operators.

[nuget]: https://www.nuget.org/
{'fraction_non_alphanumeric': 0.040697674418604654, 'fraction_numerical': 0.001998546511627907, 'mean_word_length': 4.887700534759358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5743596', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1183, 'n_words': 782}