Esempio n. 1
0
        //Routes List Methods***********************************************************************************************************************************************************//

        private void routesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedItem = ((LongListSelector)sender).SelectedItem;

            if (selectedItem is OCDirection)
            {
                OCDirection stop = (OCDirection)selectedItem;
                Navigation.NavigateToStopRoute(stop.RouteNo.ToString(), stop.RouteLabel);
            }
            else if (selectedItem is OCStop)
            {
                OCStop stop = (OCStop)selectedItem;
                Navigation.NavigateToStopRoute(stop.stop_code.ToString(), stop.stop_name);
            }
            ((LongListSelector)sender).SelectedItem = null;
        }
Esempio n. 2
0
        private static void drawMapMarker(OCStop stop, Color color, MapLayer mapLayer, Boolean action)
        {
            // Create a map marker
            Pushpin pin = new Pushpin();

            pin.Background    = new SolidColorBrush(color);
            pin.GeoCoordinate = new GeoCoordinate(stop.stop_lat, stop.stop_lon);
            if (stop.stop_code.Length > 0)
            {
                pin.Name = stop.stop_code + " - " + stop.stop_name;
                if (action)
                {
                    pin.Tap += mapPinTapped;
                }
                layMarker(pin, stop.stop_lat, stop.stop_lon, mapLayer);
            }
        }