protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); LocationManager locationManager = (LocationManager)GetSystemService(LocationService); location = new Geolocation(locationManager); // // Get our button from the layout resource, // and attach an event to it Button getLocationButton = FindViewById <Button>(Resource.Id.GetLocationButton); watchButton = FindViewById <Button>(Resource.Id.WatchButton); locationTextView = FindViewById <TextView>(Resource.Id.LocationTextView); getLocationButton.Click += delegate { LogDeviceInfo(); GetCurrentPosition(); }; watchButton.Click += delegate { ToggleWatch(); }; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); LocationManager locationManager=(LocationManager) GetSystemService(LocationService); location = new Geolocation(locationManager); // // Get our button from the layout resource, // and attach an event to it Button getLocationButton = FindViewById<Button>(Resource.Id.GetLocationButton); watchButton = FindViewById<Button>(Resource.Id.WatchButton); locationTextView = FindViewById<TextView>(Resource.Id.LocationTextView); getLocationButton.Click += delegate { LogDeviceInfo(); GetCurrentPosition(); }; watchButton.Click += delegate { ToggleWatch(); }; }
public NearestAirportService(IGeolocation locationService, ITinyMessengerHub messenger) { _locationService = locationService; _messenger = messenger; _airportsService = new AirportNamesService(); _messenger.Subscribe <FindNearestAirportMessage>(m => FindNearestAirport()); }
public async Task <IGeolocationProvider> RefetchAsync(CancellationToken token = default) { using (var client = new HttpClient()) { var resp = await client.GetAsync("http://ip-api.com/json"); var json = await resp.Content.ReadAsStringAsync(); var info = JsonConvert.DeserializeObject <GeolocationInfo>(json); this._json = json; this._info = info; return(this); } }
public MainViewModel(IDialogService dialog, INavigationService nav, IGeolocation geo) { diaService = dialog; navService = nav; geoService = geo; PropertyChanged += (sender, e) => { if (e.PropertyName == "Location") { var posn = geoService.GetLocationData(); Longitude = posn.Longitude; Latitude = posn.Latitude; Altitude = posn.Altitude; Speed = posn.Speed; Heading = posn.Heading; } }; }
public ClockPageViewModel(IPageNavigator pageNavigator, ILogger logger, IUserDialogs userDialogs, IRequestExceptionHandler requestExceptionHandler, IEventAggregator eventAggregator, ILocationManager locationManager, IGeolocation geolocation, IAppUserManager appUserManager, IEmployeeManager employeeManager, IAttendanceLogManager attendanceLogManager) : base(pageNavigator, logger, userDialogs, requestExceptionHandler, eventAggregator) { _locationManager = locationManager; _geolocation = geolocation; _appUserManager = appUserManager; _employeeManager = employeeManager; _attendanceLogManager = attendanceLogManager; BackCommand = new DelegateCommand(async() => await PageNavigator.GoBackAsync()); SubmitCommand = new DelegateCommand(async() => await OnSubmit(), () => OnSubmitCanExecute()).ObservesProperty(() => CurrentPostion).ObservesProperty(() => CurrentLocationName); _mapDragPinNewLocationEventToken = EventAggregator.GetEvent <MapDragPinNewLocationEvent>().Subscribe(async(pos) => await SetPoint(pos.Latitude, pos.Longitude)); Geofences = new ObservableCollection <Circle>(); }
protected override UnitedStates MappingTo(IGeolocation geolocation) { this.City = geolocation.RegionName; return(this); }
public static TMapping Mapping <TMapping>(this IGeolocation geolocation) where TMapping : ISelfMapping <TMapping>, new() { return(new TMapping().MappingTo(geolocation)); }
protected abstract T MappingTo(IGeolocation geolocation);
T ISelfMapping <T> .MappingTo(IGeolocation geolocation) => this.MappingTo(geolocation);
/** * Set the delegate implementation. * * @param _delegate The delegate implementing platform specific functions. */ public void SetDelegate(IGeolocation _delegate) { this._delegate = _delegate; }
/** * Constructor with delegate. * * @param _delegate The delegate implementing platform specific functions. */ public GeolocationBridge(IGeolocation _delegate) : base() { this._delegate = _delegate; }
public Weather(IConnectivity connectivity, IService service, IGeolocation geolocation) { _connectivity = connectivity; _service = service; _geolocation = geolocation; }
public MapViewModel(INavigationService navigationService, IDataStore <Business> businessStore, IGeolocation geolocation) : base(navigationService) { BusinessStore = businessStore; Geolocation = geolocation; }
public GeolocationService(IGeolocation geolocation) { _geolocation = geolocation; }
public static Task <Location?> GetLocationAsync(this IGeolocation geolocation, GeolocationRequest request) => geolocation.GetLocationAsync(request ?? new GeolocationRequest(), default);
public SplashScreenPageViewModel(INavigationService navigationService, IGeolocation geolocation, IPageDialogService pageDialogService) : base(navigationService, pageDialogService) { _geolocation = geolocation; }