I want to pass a parameter from my View to my ViewModel when a ReactiveCommand is executed that is bound to a Control. The parameter should be of type IJcUser
So I define the Command like this:
public ReactiveCommand<IJcUser, Unit> UserTouchCommand;
UserTouchCommand = ReactiveCommand.CreateFromTask(user => RootViewModel.DisplayUserProfile(user));
The signature of DisplayUserProfile
looks like
Task DisplayUserProfile(IJcUser user);
But the compiler complains because user
is from type CancelationToken
and not as expected IJcUser
I finally I found a solution but don't understand why the first approach did not work.
UserTouchCommand = ReactiveCommand.CreateFromTask<IJcUser>(RootViewModel.DisplayUserProfile);