I have got the following problem.
I have two ObservableCollections coll1
, coll2
. When adding to the first ObservableCollection coll1
I add in the coll1_CollectionChanged
some manipulated data into the coll2
- this fires up the coll2_CollectionChanged
.
According to the Action (Add, Remove, Reset) i let the coll2_CollectionCHanged
call a function. The issue is, that this function (let me call it func1
) starts another asynchronous function(a query). After the query call, the function func1
should do another actions - updating some data.
The problem is, that the coll2_CollectionChanged
EventHandler should wait until the func1
is ready (including the query), but it doesn't. All in all there are three Add Actions to the coll2_CollectionCHanged
and after each Add the EventHandler should wait for the func1
get ready.
The query in the func1
is an asynchronous function. I marked the func1
as async and call the query with await. Than I let the EventHandler call the func1
also as async - I make the EventHandler async and call the func1
with await. But it doesn't wait.