Neuro.AppToolkit.Mvvm 0.1.0-preview.2

This is a prerelease version of Neuro.AppToolkit.Mvvm.
dotnet add package Neuro.AppToolkit.Mvvm --version 0.1.0-preview.2
                    
NuGet\Install-Package Neuro.AppToolkit.Mvvm -Version 0.1.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Neuro.AppToolkit.Mvvm" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Neuro.AppToolkit.Mvvm" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Neuro.AppToolkit.Mvvm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Neuro.AppToolkit.Mvvm --version 0.1.0-preview.2
                    
#r "nuget: Neuro.AppToolkit.Mvvm, 0.1.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Neuro.AppToolkit.Mvvm@0.1.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Neuro.AppToolkit.Mvvm&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Neuro.AppToolkit.Mvvm&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

Neuro.AppToolkit.Mvvm

MVVM building blocks for any .NET app. It doesn't depend on MAUI, so it works with MAUI, WPF, WinUI, Avalonia and tests alike.

BindableTask

BindableTask<TResult> wraps a TaskObserver from Neuro.AppToolkit.Resilience for data binding. It exposes the observer's snapshots as bindable properties, Run, Refresh and Cancel commands and typed Start, RunAsync, Refresh, Cancel and Reset methods, and it raises every change on the UI thread. BindableTask<TArg, TResult> does the same for work that takes an argument.

public sealed class ContactsViewModel
{
    public ContactsViewModel(IContactsApi Api)
    {
        this.Contacts = BindableTask.Create(
            Run => Api.GetContactsAsync(Run.CancellationToken),
            new TaskObserverOptions { Name = "load-contacts", Pipeline = ResiliencePresets.Network });

        this.Contacts.Start();
    }

    public BindableTask<Contact[]> Contacts { get; }
}
<ActivityIndicator IsRunning="{Binding Contacts.IsRunning}" />
<CollectionView ItemsSource="{Binding Contacts.Result}" />
<Label IsVisible="{Binding Contacts.IsOffline}" Text="You're offline. Showing saved contacts." />
<Button Command="{Binding Contacts.RefreshCommand}" Text="Refresh" />

See the BindableTask guide for the properties, commands, dispatching and arguments.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 78 10/28/2026