private async Task setMostNarrowRange() { StatusBar.GetForCurrentView().ProgressIndicator.ProgressValue = null; StatusBar.GetForCurrentView().ProgressIndicator.ShowAsync(); for (int i = 0; i < DistanceSelection.Length; i++) { radius = DistanceSelection[i]; var nearStops = (await StopTransfers.NearStops(await CurrentLocation.Get(), radius.Value)).ToList(); if (nearStops.Count > 0) { BtnDist.SelectedItem = radius; ListView.ItemsSource = nearStops.Select(s => new StopModel(s.StopGroup, true)).ToList(); break; } } StatusBar.GetForCurrentView().ProgressIndicator.HideAsync(); }
public async void SetListContent() { StatusBar.GetForCurrentView().ProgressIndicator.ProgressValue = null; StatusBar.GetForCurrentView().ProgressIndicator.ShowAsync(); var location = await CurrentLocation.Get(); //logging UniversalDirections.QueryTimes.Clear(); var sw = Stopwatch.StartNew(); var nearStops = await StopTransfers.NearStops(location, radius.Value); sw.Stop(); ListView.ItemsSource = nearStops.Select(s => new StopModel(s.StopGroup, true)).ToList(); ListView.Height = ListView.ItemsSource().Count > 0 ? double.NaN : 0; StatusBar.GetForCurrentView().ProgressIndicator.HideAsync(); PerfLogging.AddRow( "setListContent", sw.Elapsed, UniversalDirections.QueryTimes.Count, UniversalDirections.QueryTimes.Count > 0 ? UniversalDirections.QueryTimes.Average(x => x.TotalMilliseconds) : 0.0); }