Ensure that you install ReactiveUI.WPF
into your application.
Please ensure that you are targeting at least windows10.0.17763.0
i.e <TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
in your csproj file.
Your viewmodels should inherit from ReactiveObject
Use IActivatableViewModel
and WhenActivated
for lifecycle
Keep references to your subscriptions
Use disposables to manage lifetime, scope and resources:
Don't use eventhandlers, use the extension methods shipped in ReactiveMarbles.ObservableEvents.SourceGenerator
instead
When starting a WPF application from another application (e.g. Console) set RxApp.MainThreadScheduler
to a DispatcherScheduler
after creating the WPF application on a separate thread, to avoid threading errors.
Use your normal WPF concepts that you would usually use in WPF development. There's also some extension methods which will make your life easier