Esempio n. 1
0
        private async void LoadRouteNames()
        {
            try
            {
                RouteNames.Clear();
                if (Stop.Routes == null)
                {
                    return;
                }
                IsBusy = true;
                foreach (var routeId in Stop.Routes)
                {
                    //var route = await ApiLayer.GetTransitRoute(routeId, new System.Threading.CancellationToken());
                    var route = await DataSource.GetTransitRouteAsync(routeId, DataSourcePreference.All, LoadRoutesTokenSource.Token);

                    if (route.HasData)
                    {
                        RouteNames.Add(route.Data.Name);
                    }
                }
                RoutesLoaded = true;
            }
            catch (OperationCanceledException) { }
            finally
            {
                IsBusy = false;
            }
        }