Exemplo n.º 1
0
        public override async Task OnInitializing()
        {
            await base.OnInitializing();

            MapView.ZoomLevel = 11;
            RouteSelector.Y.Set(10);
            RouteSelected.Y.Set(Root.ActualHeight - 230);
            FromItemPicker.SelectionChanged.Handle(FSelectionChanged);
            ToItemPicker.SelectionChanged.Handle(TSelectionChanged);
            var nearestStations = await RidesService.GetNearestStations();

            if (nearestStations != null)
            {
                await MapView.Add(new Map.Annotation
                {
                    Title    = nearestStations[0].Name,
                    Location = new Zebble.Services.GeoLocation(nearestStations[0].Latitude, nearestStations[0].Longitude)
                });

                InitializePinsFromStations(await RidesService.GetNearestStations());
                FromItemPicker.DataSource = CustomPins.ToList();
                ToItemPicker.DataSource   = CustomPins.ToList();
            }
        }