-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rare exception in RelayCommand #7644
Comments
Any updates on this? I am getting very similar thing with Avalonia 11. Whenever I call Shouldn't Avalonia take care of automatically delegating all such calls to the UI thread by queuing them up, instead of trying to execute on the calling thread? |
No, you need to use |
Is this true of raising |
All events that should be consumed by the UI. CollectionChanged and also PropertyChanged |
@kant2002 can you double-check if the Dispatcher also helps in your situation? If so, we can close this as by design. |
Thanks for a quick response. This is rather unfortunate, and I am not sure correct. How would any "Observable" Collection (like the built-in Does it then follow that all collection or observable object manipulations that could raise either I mean the crux of the matter is that most "observable' objects may not be controllable by the user in as far as "Changed" events they raise, and yet such objects know nothing about the UI thread or Avalonia, so they just do a simple |
That's why .Add or .Remove should only happen on UiThread. Same for other UI-Libs like WPF. If you look into async collections, I can say that DynamicData (shipped with ReactiveUI) can handle this by |
Describe the bug
Sometimes RelayCommand crash application with following stack trace.
To Reproduce
I do not have reliable repro steps. This is happens occasionally and non-deterministic. It seems to be easier to repro on first or maybe second launch and then cannot repro.
dotnet run
Expected behavior
Reliably not crash application.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: