private async void LoadResults() { if (this.QueryText == String.Empty) { this.NavigateToHome(); } else { if (this.resultStations != null) { this.resultStations.Clear(); } this.InProgress = true; StationShortModel stationsData = new StationShortModel(); try { stationsData = await DataPersister.GetAllStations(); if (stationsData.Timespan != 0) { DateTime dateTime = Conversion.UnixTimeStampToDateTime(stationsData.Timespan); this.SetBranding(dateTime); } } catch (Exception) { Notification.ShowMessage("Sorry! Could not load data! Try to reconnect to Internet and then press Refresh!"); } this.ResultStations = from s in stationsData.Stations where s.Name.ToLower().Contains(this.QueryText.ToLower()) select s; this.InProgress = false; } }
private async void GetData() { if (this.allStations != null) { this.allStations.Clear(); } this.InProgress = true; StationShortModel stationsData = new StationShortModel(); try { stationsData = await DataPersister.GetAllStations(); this.AllStations = stationsData.Stations; if (stationsData.Timespan != 0) { DateTime dateTime = Conversion.UnixTimeStampToDateTime(stationsData.Timespan); this.SetBranding(dateTime); } } catch (Exception) { Notification.ShowMessage("Sorry! Could not load data! Try to reconnect to Internet and then press Refresh!"); } this.InProgress = false; }