BCA
BCA

Reputation: 8506

System.Reactive for WPF .NET 6

I'm trying to target .NET 6 for my WPF app, but because I'm using RX.net, the highest I can go is net5.0-windows10.0.19041. One example is that ObserveOnDispatcher() is not available when I'm targeting net6.0-windows, which my app makes heavy use of.

Does anybody know either A) when a .NET 6 version of RX.NET will be released, or B) any workarounds for ObserveOnDispatcher() or ObserveOn(DispatcherScheduler.Current.Dispatcher) on .NET 6?

Thanks

Upvotes: 3

Views: 2787

Answers (2)

BCA
BCA

Reputation: 8506

A relatively painless way I found was to simply add the ReactiveUI.WPF package to my WPF projects. This allowed me to advance to net6.0-windows, and also to use DispatcherScheduler. I am not using anything from ReactiveUI library, so this is technically a hack, but took 5 minutes of my time and added only a few hundred kilobytes added to the shipped binaries, so it was worth it for me to be able to move on from previously being held back on net5.0-windows10.0.19041 because of RX.

If I had more time and skill I would dig into how the ReactiveUI.WPF source code achieved this desired effect, and apply this to my own source code... maybe someone has a more elegant, non-hack solution.

Upvotes: 1

Cameron MacFarland
Cameron MacFarland

Reputation: 71856

This will be fixed in v5.1

https://github.com/dotnet/reactive/pull/1660

You could try the nightly builds as per the readme.

https://github.com/dotnet/reactive#get-nightly-builds

Upvotes: 0

Related Questions