System.Reactive.Uwp 7.0.0-preview.20

Prefix Reserved
This is a prerelease version of System.Reactive.Uwp.

Requires NuGet 2.12 or higher.

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

UWP support for Rx (Reactive Extensions for .NET)

This is part of the Reactive Extensions for .NET (Rx). Rx enables event-driven programming with a composable, declarative model. The main Rx package is System.Reactive, which provides the core types and operators. This package, System.Reactive.Uwp, provides additional support for using Rx with UWP applications (on either .NET, or the legacy Native .NET uap platform).

If you had been using the UWP support in earlier versions of Rx (pre v7), you'll know that all UI-framework-specific functionality used to live in the main System.Reactive package. See ADR 0005 (Moving UI framework support out of System.Reactive) for an in depth explanation of the reason for moving these features out into separate packages.

Getting started

In Visual Studio, create a new UWP Blank App.

Open the NuGet Package Manager for the new project, and in the Browse tab, search for System.Reactive.Uwp. Install the package.

You can then add the following code to your MainPage.xaml.cs. First, add this using directive at the top of the file:

using System.Reactive.Linq;

Then inside the constructor, after the call to InitializeComponent() add this:

TextBlock t = new() { FontSize = 24 };
((Grid)this.Content).Children.Add(t);

IObservable<long> ticks = Observable.Timer(
    dueTime: TimeSpan.Zero,
    period: TimeSpan.FromSeconds(1));

ticks
    .ObserveOn(this)
    .Subscribe(tick => t.Text = $"Tick {tick}");

This creates an observable source (ticks) that produces an event once every second. It adds a handler to that source that updates text in a TextBlock (which this constructor adds to the window's main Grid). By default, an Observable.Timer created in this way will raise events on a thread pool thread, which would result in an exception when trying to access the TextBlock. This example avoids that problem by calling ObserveOn(this). This invokes an overload of ObserveOn that is specific to the System.Reactive.Uwp library. It declares that we want a wrapper around the ticks observable that will raise notifications through the specified Dispatcher. So when the handler specified in Subscribe executes, it does so on the dispatcher thread, meaning it is able to update the text successfully.

Feedback

You can create issues at the https://github.com/dotnet/reactive repository

Product Compatible and additional computed target framework versions.
.NET net9.0-windows10.0.26100 is compatible.  net10.0-windows was computed. 
Universal Windows Platform uap10.0.18362 is compatible. 
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
7.0.0-preview.20 31 6/3/2026
7.0.0-preview.16 51 5/26/2026
7.0.0-preview.15 52 5/20/2026