ReactiveUI Handbook¶
The handbook teaches ReactiveUI one topic at a time. Every page starts from a runnable example project in the ReactiveUI repository. Each code block on a page is copied from that project, and the text under it shows what the code prints. To see a page's code run, clone the repository and run its project:
dotnet run --project src/examples/Documentation/Pages/commands
The examples use small apps you already know: a to-do list, a school, a library, a shop, a recipe book and a music player. The data is in memory, so nothing needs a server.
Start here¶
Read these in order. Together they build a complete app.
| Page | What you learn |
|---|---|
| Starting an app | Start ReactiveUI with the app builder and choose its services. |
| Registration | Register your own services, views and view models. |
| View models | Write a view model the view can bind to. |
| Commands | Run an action from a button, with its state and errors. |
| Data binding | Keep a view and its view model in step. |
| WhenActivated | Start work when a view appears and stop it when the view goes away. |
| Interactions | Let a view model ask the view a question. |
| Routing | Move between pages and go back. |
| View location | Find the view for a view model. |
Topics¶
| Page | What you learn |
|---|---|
| Collections | React to items added to and removed from a list. |
| Message bus | Send messages between parts of an app that do not know each other. |
| Scheduling | Choose which thread work runs on. |
| Data persistence | Save and restore the app's state when the operating system pauses or closes it. |
| Default exception handler | Decide what happens to an error nobody handles. |
| Testing | Test view models without a UI. |
| Platforms | Use ReactiveUI with WPF, Windows Forms, WinUI, MAUI, Blazor and Android. |
| Members that need reflection | Which members do not work with trimming or Native AOT, and what to use instead. |
Related projects¶
Each of these libraries has its own repository and its own section.
- ReactiveUI.Binding runs ReactiveUI's bindings, property observation and view location.
- ReactiveUI.SourceGenerators writes reactive properties and commands.
- ReactiveUI.Validation adds validation rules to view models.
- Sextant navigates by view model.
- ReactiveUI.Maui.Plugins.Popup adds reactive popup pages to MAUI.
- Splat provides dependency injection and logging.
- ReactiveUI.Primitives provides the streams and operators, and ObservableEvents turns .NET events into streams.
- Akavache caches data and settings on the device.
To move an existing app to this version, see Upgrading.