コード例 #1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            String idString = "";
            if (!NavigationContext.QueryString.TryGetValue("stopId", out idString))
            {
                Debug.WriteLine("No stop ID provided!");
                NavigationService.GoBack();
                return;
            }
            stopId = UInt32.Parse(idString);
            Debug.WriteLine("Stop id: " + stopId);

            OmnibussModel model = new OmnibussModel();
            Stop stop = model.GetStop(stopId);
            Panorama.Title = stop.Name;

            routeList.ItemsSource = routes = model.GetRoutesByStop(stop);

            addLocationPin(stop.Latitude, stop.Longitude, stop.Name);
            map1.Center = new GeoCoordinate((double)stop.Latitude, (double)stop.Longitude);
        }