The majority of mobile applications start by loading Data asynchronously , While the best practice is that all the async methods expose a Task and should be awaited , this cannot be achieved with as there is no async constructors usually it end up with something like this.

public class HomePageViewModel:INotifyPropertyChanged {

private List<ArticleViewModel> _articles; public List<ArticleViewModel> Articles

{

get => _articles;

set

{

_articles = value;

OnPropertyChanged();

}

} public HomePageViewModel()

{

GetNews();

} private async void GetNews()

{

using (var httpClient = new HttpClient())

{

var rawResponse = await httpClient.GetStringAsync(

"https://newsapi.org/v2/top-headlines?country=us&apiKey=dd652e7605d54451a4179d0b28d3f928"); var response = JsonConvert.DeserializeObject<NewsResponse>(rawResponse);

Articles = response.Articles

.Select(article => new ArticleViewModel(article.Title, article.Description, article.UrlToImage)).ToList();

}

}

}

while this code will work as expected it will impose some problems

1- Async Void !!! check john Thiriet article for the async void problems

2- The GetNews is impure function that modify the global state check Alvin Alexander for the benefits of pure functions.

using async Task GetNews and/or ObservableCollection wont be better as you wont be able to wait the GetNews and you will be forced to loop and add in observableCollection