-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
We will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information. This repository's issues are reserved for feature requests and bug reports. For support questions, please ask on StackOverflow: https://stackoverflow.com/questions/tagged/reactiveui
Please delete this note before pressing the submit button
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
After binding the command to , for instance, a button. Click the button will cause System.InvalidOperationException indicating that object owns by another thread right after the callback returns.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
in xaml:
<Button Command="{Binding MyCommand}"></Button>
in viewmodel:
public ReactiveCommand MyCommand { get; protected set; }
public MainWindowViewModel()
{
MyCommand =ReactiveCommand.CreateFromTask(() =>
{
Console.WriteLine("foo"); //this works
return Task.Run(() => {
});
});//cause exception right after return
}
What is the expected behavior?
Works as any command. No exception.
What is the motivation / use case for changing the behavior?
Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI? Please also test with the latest stable and development snapshot
In v8.3.1 with reactive 3.3.1 & .net 4.7.1 WPF project
Same codes work fine in v7.4
Other information (e.g. stacktraces, related issues, suggestions how to fix)