Ejemplo n.º 1
0
        private void createController(object parameter)
        {
            var mapProxy = new PhoneMapProxy(MapControl);

            if (parameter is StopParameter)
            {
                var stopController = new StopMapController();
                stopController.Bind(mapProxy, parameter);
                stopController.StopGroupSelected += stopController_StopGroupSelected;
                stopController.TimeTableSelected += stopController_TimeTableSelected;
                stopController.TripSelected      += stopController_TripSelected;
                this.controller = stopController;
            }
            else if (parameter is TripParameter)
            {
                var tripController = new TripMapController();
                tripController.Bind(mapProxy, parameter);
                tripController.StopSelected += tripController_StopSelected;
                this.controller              = tripController;
            }
            else if (parameter is Way)
            {
                var planController = new PlanMapController();
                planController.Bind(mapProxy, parameter);
                this.controller = planController;
            }
            else
            {
                throw new ArgumentException("Invalid MapPage parameter.");
            }
        }
Ejemplo n.º 2
0
 private void bindMapController()
 {
     this.mapController = new StopMapController();
     mapController.Bind(new WinMapProxy(Map), ViewModel.OriginalParameter);
     mapController.StopGroupSelected += mapController_StopGroupSelected;
     mapController.TimeTableSelected += mapController_TimeTableSelected;
     mapController.TripSelected      += mapController_TripSelected;
 }
Ejemplo n.º 3
0
 private void bindMapController()
 {
     this.mapController = new StopMapController();
     mapController.Bind(new WinMapProxy(Map), new StopParameter {
         IsNear = true
     });
     mapController.StopGroupSelected += mapController_StopGroupSelected;
     mapController.TimeTableSelected += mapController_TimeTableSelected;
     mapController.TripSelected      += mapController_TripSelected;
 }
Ejemplo n.º 4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (e.NavigationMode == NavigationMode.New)
            {
                if (NavigationContext.QueryString.ContainsKey("stopGroupID"))
                {
                    var controller = new StopMapController();
                    controller.Bind(this);
                }
                else if (NavigationContext.QueryString.ContainsKey("tripId"))
                {
                    var controller = new TripMapController();
                    controller.Bind(this);
                }
                else if (NavigationContext.QueryString.ContainsKey("plan"))
                {
                    var controller = new PlanMapController();
                    controller.Bind(this);
                }

                locationMarkingTask = new PeriodicTask(10000, DoLocationMarking);
                locationMarkingTask.Run(preExecute: true);
            }
            else
            {
                if (locationMarkingTask != null)
                {
                    locationMarkingTask.Resume();
                }
                foreach (var task in Tasks)
                {
                    task.Resume();
                }
            }
        }