Example #1
0
        private void _serviceConnection_ServiceConnected(object sender, ServiceConnectedEventArgs e)
        {
            Console.WriteLine(nameof(_serviceConnection_ServiceConnected) + " MainActivity ServiceConnection Service Connected");
            //_lblServiceStatus.Text = "Connected";
            //_lblServiceConnectedTime.Text = string.Format("Connected @ {0}", DateTime.Now.ToString(@"hh\:mm tt"));

            string bTime = "Broadcast Time: {0} {1}";

            if (Location_BroadCastTime > 59) //In case dynamic values
            {
                bTime = string.Format(bTime, Location_BroadCastTime, "Min");
            }
            else
            {
                bTime = string.Format(bTime, Location_BroadCastTime, "Sec");
            }

            //_lblBroadcastTimeInterval.Text = bTime;

            //Service is connected and ready use.
            if (Location != null)
            {
                Location.LocationChanged += Location_LocationChanged;
            }
        }
Example #2
0
 private void _serviceConnection_ServiceDisconnected(object sender, ServiceConnectedEventArgs e)
 {
     if (Location != null)
     {
         Location.LocationChanged -= Location_LocationChanged;
     }
     Console.WriteLine(nameof(_serviceConnection_ServiceConnected) + " MainActivity ServiceConnection Service Disconnected");
 }
 void OnLocationServiceConnected(object sender, ServiceConnectedEventArgs e)
 {
     viewModel = GeolocationHelper.Current.LocationService.ViewModel;
     viewModel.PropertyChanged += OnPropertyChanged;
     ResetTrip();
 }