public static CoronavirusCountiresChartViewModel LoadViewModel(ICoronavirusCountryService coronavirusCountryService, Action <Task> onloaded = null) { CoronavirusCountiresChartViewModel viewModel = new CoronavirusCountiresChartViewModel(coronavirusCountryService); viewModel.Load().ContinueWith(t => onloaded?.Invoke(t)); return(viewModel); }
public MainViewModel() { ICoronavirusCountryService coronavirusCountryService = new APICoronavirusCountryService(); CoronavirusCountiresChartViewModel = CoronavirusCountiresChartViewModel.LoadViewModel(coronavirusCountryService); }