コード例 #1
0
ファイル: MapPage.xaml.cs プロジェクト: gyurisb/bpmenetrend
        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 bindMapController()
        {
            if (mapController != null)
            {
                mapController.Dispose();
            }

            var tripParam = new TripParameter
            {
                Stop     = ViewModel.Trip.Stop,
                Trip     = ViewModel.Trip.Trip,
                DateTime = ViewModel.Trip.GetTimeOfCurrentStop()
            };

            this.mapController = new TripMapController();
            mapController.Bind(new WinMapProxy(Map), tripParam);
            mapController.StopSelected += mapController_StopSelected;
        }
コード例 #3
0
ファイル: MapPage.xaml.cs プロジェクト: gyurisb/bpmenetrend
        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();
                }
            }
        }