How can i execute the UpdateTasklist() Method after the SubmitWorkitem() Method without blocking the thread?
private async void SubmitWorkitem(Workitem workitem)
{
await Task.Run(() => this.SubmitWorkitem(workitem));
//UpdateTasklist() should be executed after SubmitWorkitem() method.
//How can i achieve this without blocking the UI thread?
var locator = new ViewModelLocator();
locator.Task.UpdateTasklist();
}
EDIT:
The UpdateTasklist() method connects to an wcf webservice and asks for all open workitems. The workitem which is submitted in the SubmitWorkitem() Method is still part of the reply. I thought that would be because UpdateTasklist() is executed before the submission of the workitem is done.
Note that UpdateTasklist() is also an async method