System.Reactive.Uwp
7.0.0-preview.20
Prefix Reserved
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
<PackageReference Include="System.Reactive.Uwp" Version="7.0.0-preview.20" />
<PackageVersion Include="System.Reactive.Uwp" Version="7.0.0-preview.20" />
<PackageReference Include="System.Reactive.Uwp" />
paket add System.Reactive.Uwp --version 7.0.0-preview.20
#r "nuget: System.Reactive.Uwp, 7.0.0-preview.20"
#:package System.Reactive.Uwp@7.0.0-preview.20
#addin nuget:?package=System.Reactive.Uwp&version=7.0.0-preview.20&prerelease
#tool nuget:?package=System.Reactive.Uwp&version=7.0.0-preview.20&prerelease
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 | Versions 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. |
-
net9.0-windows10.0.26100
- System.Reactive (>= 7.0.0-preview.20)
- System.Reactive.WindowsRuntime (>= 7.0.0-preview.20)
-
UAP 10.0.18362
- Microsoft.NETCore.UniversalWindowsPlatform (>= 6.2.14)
- System.Reactive (>= 7.0.0-preview.20)
- System.Reactive.WindowsRuntime (>= 7.0.0-preview.20)
- System.Threading.Tasks.Extensions (>= 4.6.3)
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 |