I have two tasks, one of which I would like to complete before the next one begins. I have tried turning these into a task and using task.Wait() but they are still executed at the wrong time. Using a short sleep works but I would like to avoid sleeping.
private async void BuildNextData(object sender, RoutedEventArgs e)
{
try
{
await this._LocalCluster.DataItem(this._LocalSceneIID.IID.Value, ".Data.DataPopupNext", null, null, null);
System.Threading.Thread.Sleep(500);
object o = await GetVentuxIndex(".Data.DataPopupCurrentIndex");
Workspace.This.MainJsonBond.SelectedfilteredPopupWorries = Workspace.This.MainJsonBond.filteredPopupWorries[Int32.Parse(o.ToString())];
}
catch (Exception ex)
{
}
}