I have this code that's run after a button is pressed:
partial void DownloadPressed(NSObject sender)
{
Console.WriteLine("Pressed");
BeginInvokeOnMainThread(() => {
Label1.StringValue = "Fetching Data";
Label2.StringValue = "Fetching Data";
Label3.StringValue = "Fetching Data";
);
DownloadFromAzure();
Label1.StringValue = "Phrases: " + psNet.Count;
Label2.StringValue = "CategorySource: " + csNet.Count;
Label3.StringValue = "CategoryGroupSource: " + cgsDb;
}
I've tried quite a few different things but I cannot get it to display the Fetching Data messages. I assume this is because it's all running in the same thread with no waiting.
Can anyone give me advice on how I could run the method with an await.
private static void DownloadFromAzure()
{
// Some database and HTTP calls here
}