I have a screen that retrieves information from a remote server and displays that information to the user. I would like this information to be updated when the screen is displayed (requiring no additional user interaction).
The code I ended up with looks like this:
protected override void OnAppearing()
{
base.OnAppearing();
Task task = UpdateField();
}
protected async Task UpdateField()
{
try { MyLabel.Text = (await GoGetTheData ()).Stuff; }
catch(Exception ) { MyLabel.Text = "Nope"; }
}
In this case, since I'm catching all exceptions in UpdateField(), is there any downside/danger to storing the Task into a local variable and then ignoring it?