is it okay when UI is freezed for 5 seconds, when a button is clicked at first time? I mean when I click the button to load content from website, then I cannot move the window for 5 seconds.
My code looks like this:
private async void Button_Click(object sender, RoutedEventArgs e)
{
var html = await GetHtmlAsync("http://msdn.microsoft.com");
MessageBox.Show(html.Substring(0, 10));
}
public async Task<string> GetHtmlAsync(string url)
{
var webClient = new WebClient();
return await webClient.DownloadStringTaskAsync(url);
}
However, if I click the above button the second time or click other async
buttons, then there is no UI freezing.
So is it okay when UI is freezed for 5 seconds, when a button is clicked at first time?