コード例 #1
0
        public HomeViewModel(IMvxMessenger messenger, ITrackFacade track, IGeoLocationWatcher geoWatcher, IStoredSettingsService storedSettingsService, ISynchronisationService synchronisationService)
        {
            _messenger             = messenger;
            _track                 = track;
            _geoWatcher            = geoWatcher;
            _storedSettingsService = storedSettingsService;
            IsBound                = _geoWatcher.IsBound;

            this.synchronisationService = synchronisationService;

            logoutCommand = new MvxCommand(() =>
            {
                _track.StopServices();
                _storedSettingsService.IsAuthorized = false;
                Close(this);
                ShowViewModel <LoginViewModel>();
            });
            _profileCommand    = new MvxCommand(() => { ShowViewModel <ProfileViewModel>(); });
            _payCommand        = new MvxCommand(() => { });
            _payHistoryCommand = new MvxCommand(() => { ShowViewModel <PayHistoryViewModel>(); });
            _trackingCommand   = new MvxCommand(async() =>
            {
                Log.LogMessage("Tracking button is pressed!");
                IsBound = !IsBound;

                var result = IsBound ? await _track.StartServices() : _track.StopServices();
                IsBound    = _geoWatcher.IsBound;
            });

            _tokens = new List <MvxSubscriptionToken>();
        }
コード例 #2
0
        public HomeDebugViewModel(IMvxMessenger messenger, ITrackFacade track, IGeoLocationWatcher geoWatcher, IStoredSettingsService storedSettingsService, ISynchronisationService synchronisationService)
        {
            _track      = track;
            _messenger  = messenger;
            _geoWatcher = geoWatcher;
            IsBound     = _geoWatcher.IsBound;
            this.synchronisationService = synchronisationService;
            _storedSettingsService      = storedSettingsService;

            _tokens = new List <MvxSubscriptionToken>();
        }
コード例 #3
0
        public HomeViewModel(IMvxMessenger messenger, ITrackFacade track,
                             IGeoLocationWatcher geoWatcher, IStoredSettingsService storedSettingsService,
                             ISynchronisationService synchronisationService, IWaypointChecker waypointChecker,
                             IGeoDataService geoDataService)
        {
            _messenger                  = messenger;
            _track                      = track;
            _geoWatcher                 = geoWatcher;
            _storedSettingsService      = storedSettingsService;
            this.WaypointChecker        = waypointChecker;
            this.synchronisationService = synchronisationService;
            this.geoDataService         = geoDataService;

            IsBound = _geoWatcher.IsBound;

            logoutCommand = new MvxCommand(() =>
            {
                _track.StopServices();
                _storedSettingsService.IsAuthorized = false;
                Close(this);
                ShowViewModel <LoginViewModel>();
            });
            _profileCommand    = new MvxCommand(() => { ShowViewModel <ProfileViewModel>(); });
            _payCommand        = new MvxCommand(() => { ShowViewModel <PayViewModel>(); });
            _payHistoryCommand = new MvxCommand(() => { ShowViewModel <PayHistoryViewModel>(); });
            _trackingCommand   = new MvxCommand(async() =>
            {
                Log.LogMessage("Tracking button is pressed!");
                IsBound = !IsBound;

                var result = IsBound ? await _track.StartServicesAsync() : _track.StopServices();
                IsBound    = _geoWatcher.IsBound;
            });

            _tokens = new List <MvxSubscriptionToken>();

            NextGeoLocationCommand    = new MvxCommand(() => NextLocation());
            PlayPauseIterationCommand = new MvxCommand(() => PlayPauseLocationIteration());
            WaypointActions           = new List <WaypointAction>()
            {
                WaypointAction.Entrance,
                WaypointAction.Bridge,
                WaypointAction.Exit
            };
            SelectedWaypointAction = WaypointAction.Entrance;
        }