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 LocationService(IMvxLocationWatcher locationWatcher, IMvxMainThreadAsyncDispatcher dispatcher) { this._locationWatcher = locationWatcher; this._dispatcher = dispatcher; this._locationWatcher.OnPermissionChanged += PermissionChanged; }
public NavigationService(IMvxMessenger messenger, IMvxLocationWatcher watcher, ILocationService locationService) { _messenger = messenger; _messageToken = _messenger.Subscribe <LocationMessage>(OnLocationMessage); _locationService = locationService; _mapDataCache = XMLHelper.LoadMAPData().ToList(); }
public GpsService(IMvxLocationWatcher locationWatcher) { _locationWatcher = locationWatcher; if (!_locationWatcher.Started) { _locationWatcher.Start(new MvxLocationOptions(), OnSuccess, OnError); } }
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(); }
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; }
public LocationServiceSingleton(IApplicationSettingServiceSingleton applicationSettingService, IMvxLocationWatcher mvxLocationWatcher) { if (applicationSettingService == null) { throw new ArgumentNullException("applicationSettingService"); } _applicationSettingService = applicationSettingService; _watcher = mvxLocationWatcher; }
public LocationViewModel( ILoggerFactory logProvider, IMvxNavigationService navigation, IMvxLocationWatcher locationWatcher) : base(logProvider, navigation) { _locationWatcher = locationWatcher; StartCommand = new MvxAsyncCommand(DoStartCommand, () => !_locationWatcher.Started); }
/// <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; }
//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); }
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); }
public LocationViewModel( IMvxLogProvider logProvider, IMvxNavigationService navigation, IMvxLocationWatcher locationWatcher) : base(logProvider, navigation) { _locationWatcher = locationWatcher; StartCommand = new MvxAsyncCommand( async() => await DoStartCommand().ConfigureAwait(true), () => !_locationWatcher.Started); }
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]"; }
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); }
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"; } }
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); }
/// <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); }
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"; }); }
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; }
public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger) { _watcher = watcher; _messenger = messenger; _watcher.Start(new MvxLocationOptions(), OnLocation, OnError); }
public PersonBaseViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher) { SampleAppService = sampleAppService; LocationWatcher = locationWatcher; }
public LocationService(IMvxLocationWatcher locationWatcher, IMvxMessenger messenger) { _locationWatcher = locationWatcher; _messenger = messenger; start(); }
public MainViewModel(IMvxLocationWatcher locationWatcher) { this.locationWatcher = locationWatcher; }
public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger, IGeoCoderService geoCoder) { _watcher = watcher; _messenger = messenger; _geoCoder = geoCoder; }
public PersonAddViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher) : base(sampleAppService, locationWatcher) { Person = new Person(); }
public TestViewModel(IMvxLocationWatcher locationWatcher) { _locationWatcher = locationWatcher; }
public Child3ViewModel(IMvxLocationWatcher watcher) { _watcher = watcher; _watcher.Start(new MvxLocationOptions(), OnFix, OnError); }
public LocationService(IMvxLocationWatcher watcher) { this.watcher = watcher; }
public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger) { _watcher = watcher; _messenger = messenger; }
public PersonDetailViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher) : base(sampleAppService, locationWatcher) { }
private LocationManager() { _locationWatcher = Mvx.Resolve <IMvxLocationWatcher>(); _locationOptions = new MvxLocationOptions(); _locationOptions.TrackingMode = MvxLocationTrackingMode.Foreground; }
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); }