LiteObservableCollections 4.0.0
See the version list below for details.
dotnet add package LiteObservableCollections --version 4.0.0
NuGet\Install-Package LiteObservableCollections -Version 4.0.0
<PackageReference Include="LiteObservableCollections" Version="4.0.0" />
<PackageVersion Include="LiteObservableCollections" Version="4.0.0" />
<PackageReference Include="LiteObservableCollections" />
paket add LiteObservableCollections --version 4.0.0
#r "nuget: LiteObservableCollections, 4.0.0"
#:package LiteObservableCollections@4.0.0
#addin nuget:?package=LiteObservableCollections&version=4.0.0
#tool nuget:?package=LiteObservableCollections&version=4.0.0
LiteObservableCollections
Lite version of ObservableCollections with fewer features but better performance.
Features
- Lightweight observable list and collection implementations.
- Implements
INotifyCollectionChangedandINotifyPropertyChanged. - Supports batch addition via
AddRange. - ObservableViewList: reactive view over
ObservableList<T>with filter, sort, and optional projection; filter/sort are persisted across source updates.
Usage
ObservableList<T>
using LiteObservableCollections;
var list = new ObservableList<int>();
list.CollectionChanged += (s, e) => Console.WriteLine($"Action: {e.Action}");
list.Add(1);
list.Add(2);
list.AddRange(new[] { 3, 4, 5 }); // AddRange triggers a Reset event
Console.WriteLine(string.Join(", ", list)); // Output: 1, 2, 3, 4, 5
ObservableCollection<T>
using LiteObservableCollections;
var collection = new ObservableCollection<string>();
collection.CollectionChanged += (s, e) => Console.WriteLine($"Action: {e.Action}");
collection.Add("A");
collection.Add("B");
collection.AddRange(new[] { "C", "D" }); // AddRange triggers a single Add event with all new items
Console.WriteLine(string.Join(", ", collection)); // Output: A, B, C, D
Move Support
Both types support moving items:
list.Move(0, 2); // Moves the first item to index 2
collection.Move(1, 0); // Moves the second item to the first position
ObservableViewList<T>
A reactive view over an ObservableList<T> that supports filtering and sorting. Changes in the source list are reflected in the view. Filter and sort are persisted: Refresh() (e.g. when the source changes) re-applies them.
View without projection (same element type):
var source = new ObservableList<string> { "Banana", "Apple", "Cherry" };
using var view = new ObservableViewList<string>(source);
// Filter: only items containing "a"
view.AttachFilter(s => s.Contains('a'));
// view: Banana, Apple
// Reset filter
view.ResetFilter();
// Sort by default comparer (or AttachSort(comparison))
view.AttachSort();
// view: Apple, Banana, Cherry
// Restore source order
view.ResetSort();
View with projection (ObservableViewList<TSource, TResult>):
var source = new ObservableList<int> { 1, 2, 3 };
using var view = new ObservableViewList<int, string>(source, x => $"Item {x}");
// view: "Item 1", "Item 2", "Item 3"
view.AttachFilter(x => x >= 2);
// view: "Item 2", "Item 3"
AttachFilter(predicate)/ResetFilter()— filter operates on source elements (before projection).AttachSort()/AttachSort(comparer)/AttachSort(comparison)/ResetSort()— sort operates on view elements. Sort is re-applied on eachRefresh().ObservableViewListimplementsIDisposable; dispose to unsubscribe from the source.
Why AddRange?
The AddRange method allows you to efficiently add multiple items at once, reducing the number of notifications and improving performance in UI scenarios.
ObservableList<T>.AddRangetriggers aResetevent for maximum compatibility.ObservableCollection<T>.AddRangetriggers a singleAddevent with all new items, which is more efficient for most UI frameworks.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5.2
- No dependencies.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.