Пример #1
0
        private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            DateTime now                = DateTime.Now;
            string   timeOnTrip         = TimeFormatter.FormatTimes(now, JourneyStarted);
            string   timeTravelledToday = TimeFormatter.FormatTimes(timeToday, now, JourneyStarted);

            var TripTime              = FindViewById <TextView>(Resource.Id.lblTimeData);
            var TotalTodayTime        = FindViewById <TextView>(Resource.Id.lblDayTimeData);
            var DistanceTextView      = FindViewById <TextView>(Resource.Id.lblDistanceData);
            var TodayDistanceTextVoew = FindViewById <TextView>(Resource.Id.lblDayDistanceData);

            RunOnUiThread(() => {
                TripTime.Text       = timeOnTrip;
                TotalTodayTime.Text = timeTravelledToday;

                if (distance > 0)
                {
                    DistanceTextView.Text      = Convert.ToString(Math.Round((distance / 1.61), 1));
                    TodayDistanceTextVoew.Text = Convert.ToString(Math.Round((todayDistance / 1.61), 1));
                }
            });
        }