예제 #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.");
            }
        }
예제 #2
0
        private void ResultList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ResultList.SelectedItem != null)
            {
                DetailsPart.SetContent((WayModel)ResultList.SelectedItem);

                if (mapController != null)
                {
                    mapController.Dispose();
                }
                mapController = new PlanMapController();
                mapController.Bind(new WinMapProxy(Map), ((WayModel)ResultList.SelectedItem).Way);
            }
        }
예제 #3
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();
                }
            }
        }