I'm switching to the latest version of ReactiveUI (7.0) and I'm running into some incompatibilities and would like to know the suggested way to handle this:
ReactiveUI 6.x
Texts.Events().MouseUp
.InvokeCommand(ViewModel, x => x.DoSomething);
This now throws an exception:
Command requires parameters of type System.Reactive.Unit, but received parameter of type System.Windows.Input.MouseButtonEventArgs.
I fixed this by using the following code, but is this the right way?
Texts.Events().MouseUp
.Select(x => Unit.Default)
.InvokeCommand(ViewModel, x => x.DoSomething);
public static IObservable<Unit> ToSignal<TDontCare>(this IObservable<TDontCare> source) => source.Select(_ => Unit.Default);
– Lesleylesli