public async Task <ObservableCollection <ServicesViewModel> > GetServices(string key) { var activeWindowsServices = new ObservableCollection <ServicesViewModel>(); var allServices = await _webservice.GetServerOtherParamsAsync("Windows Services installed", key); var value = allServices.Value; var deserializeAll = Newtonsoft.Json.JsonConvert.DeserializeObject <List <WindowsServicesValue> >(value); var configuration = _webservice.GetServicesConfig(key); var deserializeConf = Newtonsoft.Json.JsonConvert.DeserializeObject <List <CheckedServices> >(configuration); var color = Color.FromRgb(99, 255, 74); foreach (var d in deserializeAll) { foreach (var c in deserializeConf) { if (d.ServiceName == c.ServiceName) { var status = ServicesValidator.validate(d); if (status == ServicesValidator.outcome.NotOK) { color = Color.FromRgb(192, 0, 2); } else { color = Color.FromRgb(99, 255, 74); } var service = new ServicesViewModel(d.ServiceName, d.DisplayName, d.ServiceType, d.Status, color); activeWindowsServices.Add(service); } } } return(activeWindowsServices); }