miroiu / nodify

Highly performant and modular controls for node-based editors designed for data-binding and MVVM.
https://miroiu.github.io/nodify
MIT License
1.38k stars 224 forks source link

[Question] Asynchronous loading issues #126

Closed LaiHT1211 closed 3 months ago

LaiHT1211 commented 3 months ago

Hello Miroiu. Thank you for sharing with the open source community. I tried to create or load a Connection using Task and it threw an exception:System.NotSupportedException: 'This type of CollectionView does not support changes to its SourceCollection from threads other than the dispatcher thread.' But I see that it can be loaded asynchronously in the example.Could you please give me some help or tips?

miroiu commented 3 months ago

Hi, I used BindingOperations.EnableCollectionSynchronization in the playground app (see PlaygroundViewModel), but I believe you can also use Application.Current.Dispatcher.BeginInvoke to initialize the collections.

LaiHT1211 commented 3 months ago

I try to use it is ok.Thank you .

miroiu commented 3 months ago

Feel free to reopen this issue if you need more information.