Exemplo n.º 1
0
        public LocationService(IMvxLocationWatcher watcher)
        {
            StatusMessage = "Current location is being resolved...";

            _watcher = watcher;
            _watcher.Start(new MvxLocationOptions() { TimeBetweenUpdates = new TimeSpan(0, 0, 1), Accuracy = MvxLocationAccuracy.Fine }, OnLocation, OnError);
        }
Exemplo n.º 2
0
        public LocationService(IMvxLocationWatcher locationWatcher, IMvxMainThreadAsyncDispatcher dispatcher)
        {
            this._locationWatcher = locationWatcher;
            this._dispatcher      = dispatcher;

            this._locationWatcher.OnPermissionChanged += PermissionChanged;
        }
Exemplo n.º 3
0
 public NavigationService(IMvxMessenger messenger, IMvxLocationWatcher watcher, ILocationService locationService)
 {
     _messenger       = messenger;
     _messageToken    = _messenger.Subscribe <LocationMessage>(OnLocationMessage);
     _locationService = locationService;
     _mapDataCache    = XMLHelper.LoadMAPData().ToList();
 }
Exemplo n.º 4
0
 public GpsService(IMvxLocationWatcher locationWatcher)
 {
     _locationWatcher = locationWatcher;
     if (!_locationWatcher.Started)
     {
         _locationWatcher.Start(new MvxLocationOptions(), OnSuccess, OnError);
     }
 }
Exemplo n.º 5
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _watcher.Start(new MvxLocationOptions()
     {
         Accuracy = MvxLocationAccuracy.Fine, TrackingMode = MvxLocationTrackingMode.Background
     }, OnLocation, OnError);
 }
        //Init
        //

        public WeatherPagedViewModel(WeatherPageModel model, IMvxLocationWatcher watcher, IMvxMessenger massager)
        {
            _massager = massager;
            _token    = _massager.Subscribe <CitiesMassage>(OnUpdateCities);
            _watcher  = watcher;
            _watcher.Start(new MvxLocationOptions(), locationEventHandleAction, errorEventHandleAction);
            _model = model;
            this.InitViewModels();
        }
Exemplo n.º 7
0
        public LocationService(IMvxLocationWatcher watcher)
        {
            StatusMessage = "Current location is being resolved...";

            _watcher = watcher;
            _watcher.Start(new MvxLocationOptions()
            {
                TimeBetweenUpdates = new TimeSpan(0, 0, 1), Accuracy = MvxLocationAccuracy.Fine
            }, OnLocation, OnError);
        }
        public FirstViewModel(IMvxLocationWatcher locationWatcher)
        {
            this.locationWatcher = locationWatcher;

            Permission = "not specified";
            Location   = "zero";

            locationWatcher.OnPermissionChanged += OnPermissionChanged;
            locationWatcher.Start(new MvxLocationOptions(), OnLocationUpdated, OnLocationError);
        }
        public LocationServiceSingleton(IApplicationSettingServiceSingleton applicationSettingService, IMvxLocationWatcher mvxLocationWatcher)
        {
            if (applicationSettingService == null)
            {
                throw new ArgumentNullException("applicationSettingService");
            }

            _applicationSettingService = applicationSettingService;
            _watcher = mvxLocationWatcher;
        }
Exemplo n.º 10
0
        public LocationServiceSingleton(IApplicationSettingServiceSingleton applicationSettingService, IMvxLocationWatcher mvxLocationWatcher)
        {
            if (applicationSettingService == null)
            {
                throw new ArgumentNullException("applicationSettingService");
            }

            _applicationSettingService = applicationSettingService;
            _watcher = mvxLocationWatcher;
        }
Exemplo n.º 11
0
        public LocationViewModel(
            ILoggerFactory logProvider,
            IMvxNavigationService navigation,
            IMvxLocationWatcher locationWatcher)
            : base(logProvider, navigation)
        {
            _locationWatcher = locationWatcher;

            StartCommand = new MvxAsyncCommand(DoStartCommand, () => !_locationWatcher.Started);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Constructor for the vehicle service. This service relies on have GPS, Internet and SNTP to sync time correctly. If the SNTP is not
 /// available then the device time is used.
 /// </summary>
 /// <param name="locationService"></param>
 /// <param name="dataAnalyticsService"></param>
 /// <param name="sNTPService"></param>
 /// <param name="networkService"></param>
 /// <param name="timerService"></param>
 /// <param name="GLOSAWebService"></param>
 /// <param name="GLOSAWiFiService"></param>
 public VehicleService(IMvxMessenger messenger, IMvxLocationWatcher watcher, ILocationService locationService, IDataAnalyticsService dataAnalyticsService, ISNTPService sNTPService, INetworkService networkService, ITimerService timerService, IGLOSAWebService GLOSAWebService, IGLOSAWiFiService GLOSAWiFiService)
 {
     _GLOSAAnalyticsService = dataAnalyticsService;
     _sntpService           = sNTPService;
     _networkService        = networkService;
     _timerService          = timerService;
     _GLOSAWebService       = GLOSAWebService;
     _navigationService     = new NavigationService(messenger, watcher, locationService);
     _GLOSAWiFiService      = GLOSAWiFiService;
     _locationService       = locationService;
 }
Exemplo n.º 13
0
        //private readonly MvxMessenger _messenger;

        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher   = watcher;
            _messenger = messenger;
            var options = new MvxLocationOptions
            {
                MovementThresholdInM = 2500
            };

            _watcher.Start(options, OnLocation, OnError);
        }
Exemplo n.º 14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.map_screen);

            _locationWatcher = Mvx.Resolve <IMvxLocationWatcher>();
            var options = new MvxLocationOptions();

            _locationWatcher.Start(options, OnLocationFound, OnLocationNotFound);
        }
Exemplo n.º 15
0
        public LocationViewModel(
            IMvxLogProvider logProvider,
            IMvxNavigationService navigation,
            IMvxLocationWatcher locationWatcher)
            : base(logProvider, navigation)
        {
            _locationWatcher = locationWatcher;

            StartCommand = new MvxAsyncCommand(
                async() => await DoStartCommand().ConfigureAwait(true),
                () => !_locationWatcher.Started);
        }
Exemplo n.º 16
0
        public FirstViewModel(IMvxLocationWatcher locationWatcher)
        {
            _locationWatcher = locationWatcher;

            _locationWatcher.Start(new MvxLocationOptions {
                Accuracy = MvxLocationAccuracy.Fine
            }, OnLocation, OnError);
            _lat = _locationWatcher.CurrentLocation.Coordinates.Latitude;
            _lng = _locationWatcher.CurrentLocation.Coordinates.Longitude;
            _locationWatcher.Stop();
            System.Diagnostics.Debug.WriteLine($"Lat: {Lat} Lng: {Lng}");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SpeedAdvisoryViewModel"/> class.
        /// </summary>
        public SpeedAdvisoryViewModel(IMvxMessenger messenger, IMvxLocationWatcher watcher)
        {
            _vehicleService          = Mvx.Resolve <IVehicleService>();
            _textToSpeechService     = new TextToSpeechService();
            _cancellationTokenSource = new CancellationTokenSource();
            _GLOSAWiFiService        = Mvx.Resolve <IGLOSAWiFiService>();
            // Task.Run(async () => await _textToSpeechService.SpeakAsync("Welcome to GLOSA", _cancellationTokenSource.Token));

            GLOSAMessage         = $"Waiting for connection (WiFi Mode: {Settings.EnableWiFiMode})";
            AdvisorySpeedMessage = "";
            Intersection         = "[Locating intersection]";
        }
Exemplo n.º 18
0
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher   = watcher;
            _messenger = messenger;
            var options = new MvxLocationOptions()
            {
                Accuracy             = MvxLocationAccuracy.Fine,
                MovementThresholdInM = 5,
                TrackingMode         = MvxLocationTrackingMode.Foreground
            };

            _watcher.Start(options, OnLocation, OnError);
            OnLocation(_watcher.CurrentLocation);
        }
Exemplo n.º 19
0
 public LocationService(IMvxMessenger messenger, IMvxLocationWatcher location)
 {
     _messenger        = messenger;
     _location         = location;
     LocationAvailable = false;
     options           = new MvxLocationOptions()
     {
         Accuracy     = MvxLocationAccuracy.Fine,
         TrackingMode = MvxLocationTrackingMode.Background
     };
     if (!_location.Started)
     {
         InitializeLocation(options);
     }
 }
 public FirstViewModel(ICustomerService customerService, IMvxLocationWatcher watcher)
 {
     _customerService = customerService;
     _watcher = watcher;
     if (_watcher != null)
     {
         if (!_watcher.Started)
             _watcher.Start(new MvxLocationOptions(), OnLocationFound, OnError);
     }
     if (string.IsNullOrWhiteSpace(Lat) || string.IsNullOrWhiteSpace(Lon))
     {
         Lat = "12.950545";
         Lon = "77.642149";
     }
 }
Exemplo n.º 21
0
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher         = watcher;
            _messenger       = messenger;
            _locationMessage = new LocationMessage(this);
            _updateLoc_token = _messenger.Subscribe <UpdateLocMessage>(OnUpdateLocMessage);

            var options = new MvxLocationOptions
            {
                Accuracy           = MvxLocationAccuracy.Fine,
                TimeBetweenUpdates = TimeSpan.FromSeconds(2),
                TrackingMode       = MvxLocationTrackingMode.Foreground
            };

            _watcher.Start(options, OnLocation, OnError);
        }
Exemplo n.º 22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocationService" /> class.
        /// </summary>
        /// <param name="watcher">The watcher.</param>
        /// <param name="messenger">The messenger.</param>
        /// <param name="log">The log.</param>
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger, ILogger log)
        {
            this._watcher   = watcher;
            this._messenger = messenger;
            this._log       = log;

            var options = new MvxLocationOptions
            {
                Accuracy             = MvxLocationAccuracy.Fine,
                TrackingMode         = MvxLocationTrackingMode.Foreground,
                TimeBetweenUpdates   = TimeSpan.Zero,
                MovementThresholdInM = 0,
            };

            this._watcher.Start(options, this.OnLocation, this.OnError);
        }
Exemplo n.º 23
0
        public StartViewModel(IMvxNavigationService navigationService, IMvxLocationWatcher watcher)
        {
            _navigation = navigationService;
            _watcher    = watcher;
            _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
            SearchCmd = new MvxCommand(() =>
            {
                _navigation.Navigate <PostsViewModel, SearchModel>(new SearchModel {
                    KeyWord = this.KeyWord, StartDate = this.StartDate, EndDate = this.EndDate
                });
            });

            EndDate = DateTime.Now.ToShortDateString();

            SetLocationCmd = new MvxCommand(() =>
            {
                // Long = _watcher.CurrentLocation.Coordinates.Longitude;
                // Lat = _watcher.CurrentLocation.Coordinates.Latitude;
                Location = "Lublin";
            });
        }
Exemplo n.º 24
0
        public ReportViewModel(IMvxLocationWatcher watcher)
        {
            // Message subs.
            var messenger = Mvx.Resolve <IMvxMessenger>();

            _token = messenger.Subscribe <LocationMessage>(OnLocationMessage);

            // Location service.
            Mvx.RegisterSingleton <ILocationService>(new LocationService(watcher, messenger));

            // Compass.
            CrossCompass.Current.CompassChanged += (s, e) =>
            {
                Heading = e.Heading;
            };
            CrossCompass.Current.Start();

            _timer = new Utils.Timer(async(obj) =>
            {
                await CheckDanger().ConfigureAwait(false);
            }, null, 15000, 15000);
        }
		public MainViewModel(IMvxLocationWatcher locationWatcher)
		{
			this.locationWatcher = locationWatcher;
		}
Exemplo n.º 26
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }
Exemplo n.º 27
0
 public PersonBaseViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
 {
     SampleAppService = sampleAppService;
        LocationWatcher = locationWatcher;
 }
Exemplo n.º 28
0
		public LocationService(IMvxLocationWatcher locationWatcher, IMvxMessenger messenger)
		{
			_locationWatcher = locationWatcher;
			_messenger = messenger;
			start();
		}
Exemplo n.º 29
0
 public MainViewModel(IMvxLocationWatcher locationWatcher)
 {
     this.locationWatcher = locationWatcher;
 }
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger, IGeoCoderService geoCoder)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _geoCoder  = geoCoder;
 }
Exemplo n.º 31
0
 public PersonAddViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
     : base(sampleAppService, locationWatcher)
 {
     Person = new Person();
 }
Exemplo n.º 32
0
 public TestViewModel(IMvxLocationWatcher locationWatcher)
 {
     _locationWatcher = locationWatcher;
 }
Exemplo n.º 33
0
 public Child3ViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnFix, OnError);
 }
Exemplo n.º 34
0
 public LocationService(IMvxLocationWatcher watcher)
 {
     this.watcher = watcher;
 }
Exemplo n.º 35
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
 }
Exemplo n.º 36
0
 public PersonDetailViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
     : base(sampleAppService, locationWatcher)
 {
 }
Exemplo n.º 37
0
 private LocationManager()
 {
     _locationWatcher = Mvx.Resolve <IMvxLocationWatcher>();
     _locationOptions = new MvxLocationOptions();
     _locationOptions.TrackingMode = MvxLocationTrackingMode.Foreground;
 }
Exemplo n.º 38
0
 public OmnicTabsViewModel(IMvxLocationWatcher watcher)
 {
     Child1 = new Child1ViewModel(new ImageLoader());
     Child2 = new Child2ViewModel();
     Child3 = new Child3ViewModel(watcher);
 }
 public FirstViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }
 public FirstViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }