public async Task InitializeData() { await _mockDataUpdateService.InitializeMockData(); await _zoneService.InitializeData(); _currentLayerContracts = await _requestService.GetAsync <List <CurrentLayerContract> >("api/UserLocation"); _userInfoContracts = await _requestService.GetAsync <List <UserInfoContract> >("api/UserInfo"); if (_currentLayerContracts.Count > 0) { _lastUpdated = _currentLayerContracts.Max(c => c.TimeStamp); } else { _lastUpdated = DateTime.MinValue; } }
public override async Task OnAppearingAsync() { if (!Initialized) { var profile = await _requestService.GetAsync <UserInfoContract>("api/UserInfoSelf"); UserProfile = new ProfileViewModel() { UserInfo = profile }; Task[] tasks = new Task[] { _layerService.InitializeData(), _zoneService.InitializeData() }; //await _layerService.InitializeData(); //await _zoneService.InitializeData(); await Task.WhenAll(tasks); await RefreshPolygonsAsync(); Initialized = true; } }
public override async Task OnAppearingAsync() { await _zoneService.InitializeData(); ZonesList.Clear(); var zones = await _zoneService.GetAllZoneContractsAsync(); foreach (var zone in zones) { ZonesList.Add(new ZoneViewModel(zone)); } var profile = await _requestService.GetAsync <UserInfoContract>("api/UserInfoSelf"); UserProfile = new ProfileViewModel() { UserInfo = profile }; IsBusy = false; }