An open API service indexing awesome lists of open source software.

https://github.com/emako/bindableobservablecollections

Bindable extension library for ObservableCollections which is a high performance observable collections.
https://github.com/emako/bindableobservablecollections

mvvm wpf

Last synced: about 1 month ago
JSON representation

Bindable extension library for ObservableCollections which is a high performance observable collections.

Awesome Lists containing this project

README

          

> [!NOTE]
>
> **Public Archived**
> *Due to the problem of relying on the upstream agreement with Microsoft, transfer to [LiteObservableCollections](https://github.com/emako/LiteObservableCollections) to continue maintenance.*

[![NuGet](https://img.shields.io/nuget/v/BindableObservableCollections.svg)](https://nuget.org/packages/BindableObservableCollections) [![Actions](https://github.com/emako/BindableObservableCollections/actions/workflows/library.nuget.yml/badge.svg)](https://github.com/emako/BindableObservableCollections/actions/workflows/library.nuget.yml)

# BindableObservableCollections

This library provides WPF/XAML-friendly wrappers for [Cysharp/ObservableCollections](https://github.com/Cysharp/ObservableCollections), enabling direct data binding to high-performance observable collections in .NET MVVM applications.

## Features

- **BindableObservableList**
- **BindableObservableDictionary**
- **BindableObservableHashSet**
- **BindableObservableQueue**
- **BindableObservableStack**

All types expose a `NotifySource` property (a `NotifyCollectionChangedSynchronizedViewList`) that implements `INotifyCollectionChanged` and can be used directly as an `ItemsSource` in WPF, Avalonia, or WinUI.

## Example (WPF)

```csharp
public class MainViewModel : ObservableObject
{
public BindableObservableList List { get; } = new();
public NotifyCollectionChangedSynchronizedViewList ListView { get; }

public MainViewModel()
{
ListView = List.ToNotifyCollectionChanged();
}
}
```

```xml

```

## MVVM Command Integration

You can use [CommunityToolkit.Mvvm](https://github.com/CommunityToolkit/dotnet) to expose commands for adding/removing items:

```csharp
[RelayCommand]
private void AddList()
{
List.Add($"Item {List.Count + 1}");
}
```

## Supported Platforms

- .NET 6/7/8/9
- WPF, Avalonia, WinUI, Blazor, and more

## Requirements

- [ObservableCollections](https://www.nuget.org/packages/ObservableCollections)
- [CommunityToolkit.Mvvm](https://www.nuget.org/packages/CommunityToolkit.Mvvm) (optional, for MVVM command support)

## License

MIT