private Button CreateRouteDetailsButton(StopOnRoute stopOnRoute, Route route, string backSubRouteUID, string routeUID = null) { Button button = new Button(); if (routeUID == null) { routeUID = stopOnRoute.SubRouteUID.Replace(" ", ""); } string routeID = route.ParentUID.Substring(10); RouteView.RouteViewConfig Config = new RouteView.RouteViewConfig(routeID, routeUID, route.Name.En, route.HeadSign, backSubRouteUID); button.Text = string.Format("{0}", new string[] { route.HeadSign }); button.Clicked += (object sender, EventArgs e) => { Navigation.PushAsync(new RouteView(Config)); }; return(button); }
private Button CreateRouteDetailsButton(StopOnRoute stopOnRoute, IEnumerable <string> skipUIDs, List <string> processedRouteIDs) { string routeUID = stopOnRoute.SubRouteUID; if (skipUIDs.Contains(routeUID)) { return(null); } Route route = RouteSQLiteRepository.Instance.Get(routeUID); if (!processedRouteIDs.Contains(route.Number)) { processedRouteIDs.Add(route.Number); PageLayout.Children.Add(new Label { Text = route.Number, FontSize = 20, TextColor = Color.Red }); } ; return(CreateRouteDetailsButton(stopOnRoute, route, FindBackSubRouteUID(routeUID, route), routeUID)); }