public LocationService(IMvxGeoLocationWatcher watcher, IMvxMessenger messenger) { _messenger = messenger; _watcher = watcher; _watcher.Start(new MvxGeoLocationOptions(), OnSuccess, OnError); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // setup the application Setup.Instance.EnsureInitialized(ApplicationContext); // ensure location plugin is available Cirrious.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded(); // get the location instance _geoLocationWatcher = Mvx.Resolve<IMvxGeoLocationWatcher>(); // create the UI SetContentView(Resource.Layout.Main); // get the controls _latText = this.FindViewById<TextView>(Resource.Id.LatText); _lngText = this.FindViewById<TextView>(Resource.Id.LngText); _startedText = this.FindViewById<TextView>(Resource.Id.StartedText); _errorText = this.FindViewById<TextView>(Resource.Id.ErrorText); _button = this.FindViewById<Button>(Resource.Id.ToggleButton); // bind to click _button.Click += ButtonOnClick; // update all UI UpdateError(null); UpdateStarted(); UpdateLocation(null); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // setup the application Setup.Instance.EnsureInitialized(ApplicationContext); // ensure location plugin is available Cirrious.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded(); // get the location instance _geoLocationWatcher = Mvx.Resolve <IMvxGeoLocationWatcher>(); // create the UI SetContentView(Resource.Layout.Main); // get the controls _latText = this.FindViewById <TextView>(Resource.Id.LatText); _lngText = this.FindViewById <TextView>(Resource.Id.LngText); _startedText = this.FindViewById <TextView>(Resource.Id.StartedText); _errorText = this.FindViewById <TextView>(Resource.Id.ErrorText); _button = this.FindViewById <Button>(Resource.Id.ToggleButton); // bind to click _button.Click += ButtonOnClick; // update all UI UpdateError(null); UpdateStarted(); UpdateLocation(null); }
/// <summary> /// Initializes a new instance of the <see cref="LocationService"/> class. /// </summary> /// <param name="watcher">The watcher.</param> /// <param name="messenger">The messenger.</param> public LocationService( IMvxGeoLocationWatcher watcher, IMvxMessenger messenger) { this.messenger = messenger; this.watcher = watcher; this.watcher.Start(new MvxGeoLocationOptions(), this.OnSuccess, this.OnError); }
public LocationViewModel(ITopActivity topActivity, IMvxGeoLocationWatcher geoLocationWatcher) { _topActivity = topActivity; _geoLocationWatcher = geoLocationWatcher; }
public LocationViewModel() { PluginLoader.Instance.EnsureLoaded(); _watcher = Mvx.Resolve<IMvxGeoLocationWatcher>(); #warning need IsStarted check here... }
protected BaseEditMarketViewModel(string id) : base(id) { _watcher = this.GetService <IMvxGeoLocationWatcher>(); ViewUnRegistered += OnViewUnRegistered; DoStartStop(); }
public LocationViewModel() { PluginLoader.Instance.EnsureLoaded(); _watcher = Mvx.Resolve <IMvxGeoLocationWatcher>(); #warning need IsStarted check here... }
public FirstViewModel(IMvxGeoLocationWatcher watcher) { _watcher = watcher; _watcher.Start(new MvxGeoLocationOptions(), OnLocation, OnError); }
public LocationViewModel() { PluginLoader.Instance.EnsureLoaded(); _watcher = this.GetService<IMvxGeoLocationWatcher>(); ViewUnRegistered += OnViewUnRegistered; }