Beispiel #1
0
        async void SendNow_Clicked(object sender, EventArgs args)
        {
            ViewModelLocator.FugitiveViewModel.Position = await CrossGeolocator.Current.GetLastKnownLocationAsync();

            var message = new FugitiveLocationMessage()
            {
                Latitide  = ViewModelLocator.FugitiveViewModel.Position.Latitude,
                Longitude = ViewModelLocator.FugitiveViewModel.Position.Longitude
            };

            _messaging.SendFugitiveLocation(message);
        }
Beispiel #2
0
        private void PositionChanged(object sender, PositionEventArgs e)
        {
            //If updating the UI, ensure you invoke on main thread

            ViewModelLocator.FugitiveViewModel.Position = e.Position;

            var message = new FugitiveLocationMessage()
            {
                Latitide  = e.Position.Latitude,
                Longitude = e.Position.Longitude
            };

            _messaging.SendFugitiveLocation(message);
        }