I'm aware of the evils of async void methods but am not entirely sure of the best way of over coming the problem when overriding methods.
Say, I have the following code:
protected override async void PageRefreshed()
{
BoundDataField = await LoadDataFromWeb();
}
I know this is a really bad thing to do, but what is the best solution for this?
LoadDataFromWeb().ContinueWith(r => BoundDateField = r.Result);Task.Run(async ()=> await LoadDataFromWeb())).Wait;LoadDataFromWeb().WaitBoundDataField = LoadDataFromWeb.Result
I'm pretty sure that 3 & 4 are real no nos as they will be blocking the UI thread. Is there another solution I have missed?