System.Reactive.Wpf
7.0.0-preview.20
Prefix Reserved
Requires NuGet 2.12 or higher.
dotnet add package System.Reactive.Wpf --version 7.0.0-preview.20
NuGet\Install-Package System.Reactive.Wpf -Version 7.0.0-preview.20
<PackageReference Include="System.Reactive.Wpf" Version="7.0.0-preview.20" />
<PackageVersion Include="System.Reactive.Wpf" Version="7.0.0-preview.20" />
<PackageReference Include="System.Reactive.Wpf" />
paket add System.Reactive.Wpf --version 7.0.0-preview.20
#r "nuget: System.Reactive.Wpf, 7.0.0-preview.20"
#:package System.Reactive.Wpf@7.0.0-preview.20
#addin nuget:?package=System.Reactive.Wpf&version=7.0.0-preview.20&prerelease
#tool nuget:?package=System.Reactive.Wpf&version=7.0.0-preview.20&prerelease
WPF 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.Wpf, provides additional support for using Rx with WPF applications.
If you had been using the WPF 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
Run the following at a command line:
mkdir TryRxWpf
cd TryRxWpf
dotnet new wpf
dotnet add package System.Reactive.Wpf
Alternatively, if you have Visual Studio installed, create a new .NET WPF project, and then use the NuGet package manager to add a reference to System.Reactive.Wpf.
You can then add the following code to your MainWindow.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:
IObservable<long> ticks = Observable.Timer(
dueTime: TimeSpan.Zero,
period: TimeSpan.FromSeconds(1));
ticks
.ObserveOn(this.Dispatcher)
.Subscribe(tick => this.Title = $"Tick {tick}");
This creates an observable source (ticks) that produces an event once every second. It adds a handler to that source that updates the main window's title bar text. 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 set the window title bar. This example avoids that problem by calling ObserveOn(this.Dispatcher). This invokes an overload of ObserveOn that is specific to the System.Reactive.Wpf 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 window title successfully.
Feedback
You can create issues at the https://github.com/dotnet/reactive repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- System.Reactive (>= 7.0.0-preview.20)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
net8.0-windows7.0
- System.Reactive (>= 7.0.0-preview.20)
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 | 58 | 6/3/2026 |
| 7.0.0-preview.16 | 51 | 5/26/2026 |
| 7.0.0-preview.15 | 60 | 5/20/2026 |
| 7.0.0-preview.1 | 4,340 | 11/6/2025 |