ReactiveUI.Reactive 28.1.0

Prefix Reserved
dotnet add package ReactiveUI.Reactive --version 28.1.0
                    
NuGet\Install-Package ReactiveUI.Reactive -Version 28.1.0
                    
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="ReactiveUI.Reactive" Version="28.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ReactiveUI.Reactive" Version="28.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ReactiveUI.Reactive" />
                    
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 ReactiveUI.Reactive --version 28.1.0
                    
#r "nuget: ReactiveUI.Reactive, 28.1.0"
                    
#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 ReactiveUI.Reactive@28.1.0
                    
#: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=ReactiveUI.Reactive&version=28.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ReactiveUI.Reactive&version=28.1.0
                    
Install as a Cake Tool

<div align="center">

<a href="https://github.com/reactiveui/ReactiveUI"><img src="https://raw.githubusercontent.com/reactiveui/styleguide/master/logo/logo.svg" alt="ReactiveUI" width="128"></a>

ReactiveUI

Build NuGet Downloads Coverage License Discussions

</div>

What is ReactiveUI?

ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming, which is a paradigm that allows you to abstract mutable state away from your user interfaces and express the idea around a feature in one readable place and improve the testability of your application.

πŸ”¨ Get Started πŸ› Install Packages 🎞 Watch Videos πŸŽ“ View Samples 🎀 Discuss ReactiveUI

Your first view model

A view shows data that changes, so it needs to know when a value changes. Written by hand, each property needs a field and a setter that raises a change notification. Each command needs a property that wraps a method. ReactiveUI writes that code for you while your project builds.

A source generator is a compiler add-on that writes C# code during the build. The ReactiveUI packages bring two of them. ReactiveUI.SourceGenerators writes reactive properties and commands. ReactiveUI.Binding writes the code behind WhenAnyValue, ToProperty and the view bindings. You install neither yourself.

1. Install the ReactiveUI package for your UI framework. A class library that holds only view models installs ReactiveUI.

dotnet add package ReactiveUI.WPF

2. Declare the view model as a partial class and mark its members.

using ReactiveUI;
using ReactiveUI.SourceGenerators;

public partial class LoginViewModel : ReactiveObject
{
    private readonly IObservable<bool> _canLogIn;

    public LoginViewModel()
    {
        _canLogIn = this.WhenAnyValue(
            static x => x.UserName,
            static x => x.Password,
            static (userName, password) => userName.Length > 0 && password.Length > 0);

        _isValidHelper = _canLogIn.ToProperty(this, static x => x.IsValid);
    }

    [Reactive]
    public partial string UserName { get; set; } = string.Empty;

    [Reactive]
    public partial string Password { get; set; } = string.Empty;

    [ObservableAsProperty]
    public partial bool IsValid { get; }

    [ReactiveCommand(CanExecute = nameof(_canLogIn))]
    private async Task<bool> LogInAsync(CancellationToken cancellationToken)
    {
        await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
        return Password == "secret";
    }
}

WhenAnyValue returns a stream, an IObservable<T> that emits a new value each time either property changes.

3. Build. The generators write the rest of the class:

  • The bodies of UserName and Password. Setting either one raises the change notification.
  • The body of IsValid and its _isValidHelper field. ToProperty keeps IsValid equal to the latest value of _canLogIn.
  • A LogInCommand property. It holds a command, an ICommand that also reports each result as a stream. The command runs LogInAsync, and it is enabled only while _canLogIn emits true. The generator drops the Async suffix from the name.

Next, bind the properties and the command to your view with Bind and BindCommand. The ReactiveUI.Binding documentation shows how. The source generators documentation lists every attribute and option.

Partial properties with an initial value need C# 14, the default language version for .NET 10.

How the packages fit together

ReactiveUI is a set of packages. You install the package for your UI framework, and it brings the rest.

Package What it gives you
ReactiveUI ReactiveObject, ReactiveCommand, activation, routing and schedulers, built on ReactiveUI.Primitives. It brings ReactiveUI.Core and ReactiveUI.Binding.
ReactiveUI.Reactive The same API built for System.Reactive. It brings ReactiveUI.Core and ReactiveUI.Binding.Reactive.
ReactiveUI.Core The parts both flavours share. It brings ReactiveUI.SourceGenerators.
ReactiveUI.Binding WhenAnyValue, Bind, OneWayBind, BindCommand, ToProperty, [ObservableAsProperty] and view location.
ReactiveUI.SourceGenerators [Reactive], [ReactiveCommand], [ReactiveCollection], [BindableDerivedList] and [IReactiveObject].

The ReactiveUI documentation covers the core package, and the installation guide shows which package to install for each platform.

Pick a flavour

ReactiveUI comes in two flavours with the same API. They differ only in the reactive types that appear in that API.

You want Install Reactive types in the API
No System.Reactive dependency ReactiveUI, ReactiveUI.WPF, ReactiveUI.WinForms, ReactiveUI.WinUI, ReactiveUI.Maui, ReactiveUI.Blazor, ReactiveUI.AndroidX ReactiveUI.Primitives: RxVoid, ISequencer, Signal<T>
To mix with code that uses System.Reactive ReactiveUI.Reactive, ReactiveUI.WPF.Reactive, ReactiveUI.WinForms.Reactive, ReactiveUI.WinUI.Reactive, ReactiveUI.Maui.Reactive, ReactiveUI.Blazor.Reactive, ReactiveUI.AndroidX.Reactive System.Reactive: Unit, IScheduler, Subject<T>

ReactiveUI.Primitives is ReactiveUI's own library of streams, operators and schedulers. Both flavours run on it. The default flavour does not depend on System.Reactive, so your app ships fewer assemblies.

The System.Reactive flavour puts its own types in the ReactiveUI.Reactive namespace. A file that uses ReactiveObject or ReactiveCommand from it adds using ReactiveUI.Reactive;.

Bindings come from ReactiveUI.Binding

ReactiveUI runs WhenAnyValue, Bind, OneWayBind, BindCommand, ToProperty and view location on ReactiveUI.Binding. Its source generator writes the code for each binding while your project builds. Nothing looks up a property by name at run time, so bindings are safe to trim and to publish with Native AOT.

The ReactiveUI package imports the ReactiveUI.Binding namespace into your project, so binding calls need no using. Moving from an earlier version? The migration guide covers the calls that need an Unsafe twin and the behavior that changed.

Source generators come with ReactiveUI.Core

ReactiveUI.Core references ReactiveUI.SourceGenerators and passes its generators on. Every project that installs a ReactiveUI package can use [Reactive], [ReactiveCommand] and the other attributes. Add using ReactiveUI.SourceGenerators; to each file that uses them. The generators check which flavour your project references and write code for that flavour.

  • Remove your own reference to ReactiveUI.SourceGenerators, or set it to the version ReactiveUI brings or later. An older version fails to restore with error NU1605.

Analyzers

An analyzer checks your code as you type and reports problems as warnings or errors. ReactiveUI.Binding and ReactiveUI.SourceGenerators run their analyzers in your project. They report binding calls and attributes that the generators cannot handle. Diagnostic RXUIBIND021 flags a binding call with no generated binding behind it, such as one that targets a member another source generator adds or a stored lambda; that call throws at run time, so treat the warning as a bug to fix rather than suppress.

The analyzers inside ReactiveUI.Primitives stay out of your project. ReactiveUI references ReactiveUI.Primitives with ExcludeAssets="analyzers". To use them, reference ReactiveUI.Primitives directly:

<PackageReference Include="ReactiveUI.Primitives" Version="x.y.z" />

Routing

Routing (RoutingState and IScreen) is part of the ReactiveUI package. The WPF, WinUI and MAUI packages add a RoutedViewHost control that shows the current view, and Windows Forms adds RoutedControlHost. RoutingState reports navigation as streams. CurrentViewModel emits the view model on top of the stack. NavigationStackChanged emits a read-only copy of the whole stack after each change. CanNavigateBack emits whether there is a view model to go back to. The routing migration guide covers moving from the ReactiveUI.Routing package.

Platform packages

Install the package for your UI framework. Each one brings ReactiveUI. Each one except ReactiveUI.Uno has a .Reactive twin for the System.Reactive flavour.

Platform Package NuGet
Class libraries ReactiveUI CoreBadge
WPF ReactiveUI.WPF WpfBadge
WinUI ReactiveUI.WinUI WinUiBadge
MAUI ReactiveUI.Maui MauiBadge
Windows Forms ReactiveUI.WinForms WinBadge
Android (AndroidX) ReactiveUI.AndroidX DroXBadge
Blazor ReactiveUI.Blazor BlazBadge
Avalonia ReactiveUI.Avalonia AvaBadge
Uno Platform ReactiveUI.Uno UnoBadge
Unit tests ReactiveUI.Testing TestBadge

ReactiveUI.Avalonia and ReactiveUI.Uno live in their own repositories.

ReactiveUI.Validation adds validation rules for view models. It lives in its own repository. ValBadge

Documentation

  • RxSchedulers - Using ReactiveUI schedulers without RequiresUnreferencedCode attributes

Book

There has been an excellent book written by our Alumni maintainer Kent Boogart.

Sponsors

JetBrains gives ReactiveUI's maintainers licences for its tools through its open source support programme. Anthropic supports them with Claude through Claude for Open Source. OpenAI supports them with Codex through Codex for Open Source. Snyk gives the maintainers access to security tools through its Secure Developer Program.

JetBrains Claude by Anthropic OpenAI Sponsored by Snyk

See our sponsors for more information. JetBrains, Claude, Anthropic, OpenAI and Codex names and logos are trademarks of their respective owners. Snyk and the Snyk logo are trademarks of Snyk Ltd.

Migration from Xamarin and .NET 8 MAUI

Xamarin Users

As of May 2024, Microsoft ended support for Xamarin per their support policy. ReactiveUI has removed support for legacy Xamarin platforms in favor of modern .NET MAUI. For Xamarin projects:

  • Xamarin.Forms β†’ Migrate to MAUI and use ReactiveUI.Maui
  • Xamarin.Android β†’ Migrate to MAUI Android or use ReactiveUI.AndroidX for native Android
  • Xamarin.iOS/Mac β†’ Migrate to MAUI iOS/Mac Catalyst

For guidance on migrating from Xamarin to MAUI, see the official migration documentation.

MAUI Users

ReactiveUI supports .NET 10 and .NET 11 for MAUI platforms:

  • net10.0-android / net11.0-android
  • net10.0-ios / net11.0-ios
  • net10.0-maccatalyst / net11.0-maccatalyst
  • net10.0-windows10.0.19041.0 / net11.0-windows10.0.19041.0

Examples

Platform-specific sample applications are included in src/examples/:

Sample Platform Description
ReactiveUI.Samples.Wpf WPF Login form with reactive bindings, PasswordBox event marshaling
ReactiveUI.Samples.Winforms WinForms Login form with IViewFor, programmatic UI layout
ReactiveUI.Samples.Maui MAUI Cross-platform login with Shell navigation, ReactiveContentPage
ReactiveUI.Builder.WpfApp WPF Multi-instance chat app with routing, suspension, and network sync
ReactiveUI.Builder.BlazorServer Blazor Server Chat app with server-side Blazor and reactive components

All samples target .NET 10, use RxAppBuilder for initialization, and demonstrate WhenActivated, Bind/ BindCommand, and proper subscription disposal.

This is how we use the donations:

  • Allow the core team to work on ReactiveUI
  • Thank contributors if they invested a large amount of time in contributing
  • Support projects in the ecosystem

Contribute

ReactiveUI is part of ReactiveUI and is released under the MIT license. We welcome contributions of every size, from bug reports and documentation to features and tests.

Coding standards

Every pull request must meet these standards. The build checks most of them.

  • Follow the ReactiveUI C# style guide.
  • The repository's .editorconfig and the StyleSharp, PerformanceSharp and SecuritySharp analyzers run on every build. Fix each finding in the code. Do not suppress it or relax the .editorconfig.
  • Add tests for every bug fix and new feature.
  • Document public APIs with XML documentation comments.
  • Write commit messages in the Conventional Commits format.
  • Follow the Code of Conduct.

Support the project

Core Team

<table> <tbody> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/glennawatson.png?s=150"> <br> <a href="https://github.com/glennawatson">Glenn Watson</a> <p>Melbourne, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/chrispulman.png?s=150"> <br> <a href="https://github.com/chrispulman">Chris Pulman</a> <p>United Kingdom</p> </td> </tr> </tbody> </table>

Alumni Core Team

The following have been core team members in the past.

<table> <tbody> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/ghuntley.png?s=150"> <br> <a href="https://github.com/ghuntley">Geoffrey Huntley</a> <p>Sydney, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/kentcb.png?s=150"> <br> <a href="https://github.com/kentcb">Kent Boogaart</a> <p>Brisbane, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/olevett.png?s=150"> <br> <a href="https://github.com/olevett">Olly Levett</a> <p>London, United Kingdom</p> </td> </tr> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/anaisbetts.png?s=150"> <br> <a href="https://github.com/anaisbetts">AnaΓ―s Betts</a> <p>San Francisco, USA</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/shiftkey.png?s=150"> <br> <a href="https://github.com/shiftkey">Brendan Forster</a> <p>Melbourne, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/clairernovotny.png?s=150"> <br> <a href="https://github.com/clairernovotny">Claire Novotny</a> <p>New York, USA</p> </td> </tr> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/worldbeater.png?s=150"> <br> <a href="https://github.com/worldbeater">Artyom Gorchakov</a> <p>Moscow, Russia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/rlittlesii.png?s=150"> <br> <a href="https://github.com/rlittlesii">Rodney Littles II</a> <p>Texas, USA</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/cabauman.png?s=150"> <br> <a href="https://github.com/cabauman">Colt Bauman</a> <p>South Korea</p> </td> </tr> </tbody> </table>

.NET Foundation

ReactiveUI is part of the .NET Foundation. Other projects that are associated with the foundation include the Microsoft .NET Compiler Platform ("Roslyn") as well as the Microsoft ASP.NET family of projects, and Microsoft .NET Core.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-maccatalyst26.0 is compatible.  net10.0-macos was computed.  net10.0-macos26.0 is compatible.  net10.0-tvos was computed.  net10.0-tvos26.0 is compatible.  net10.0-windows was computed.  net11.0 is compatible.  net11.0-android37.0 is compatible.  net11.0-ios27.2 is compatible.  net11.0-maccatalyst27.2 is compatible.  net11.0-macos27.2 is compatible.  net11.0-tvos27.2 is compatible. 
.NET Framework net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (58)

Showing the top 5 NuGet packages that depend on ReactiveUI.Reactive:

Package Downloads
Sextant

ReactiveUI navigation for Avalonia and .NET MAUI applications.

ReactiveUI.Avalonia.Reactive

Contains the ReactiveUI Reactive platform specific extensions for Avalonia

ReactiveUI.Testing.Reactive

Provides extensions for testing ReactiveUI applications against System.Reactive, including Microsoft.Reactive.Testing TestScheduler support.

Sextant.Plugins.Popup

ReactiveUI navigation for Avalonia and .NET MAUI applications.

Runic.Application.Views.ReactiveUI.Reactive

System.Reactive-flavor ReactiveUI model-context scheduling, routing, view location, and activation for Runic Views.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ReactiveUI.Reactive:

Repository Stars
TolikPylypchuk/KeyboardSwitch
An application which switches typed text as if it were typed with another keyboard layout
Version Downloads Last Updated
28.1.0 0 11/30/2026
28.0.0 7,371 11/22/2026
27.0.1 1,617 11/16/2026
27.0.0 4,548 11/15/2026
26.0.1 61,627 10/4/2026
26.0.0 291 10/3/2026
25.1.1 12,521 9/28/2026
25.1.0 390 9/28/2026
25.0.1 374 9/27/2026
25.0.0 208 9/27/2026
24.3.0 1,695 9/24/2026
24.2.0 20,599 9/4/2026
24.1.0 9,231 8/2/2026
24.0.0 18,570 7/26/2026
24.0.0-beta.3 700 7/3/2026
24.0.0-beta.2 223 6/29/2026
24.0.0-beta.1 153 6/26/2026