// Timer toggle event async void TimerBtn_Clicked(object sender, EventArgs e) { if (TimerBtn.Text == "Start") { sw.Start(); TimerBtn.Text = "Stop"; TimerBtn.BackgroundColor = Color.Red; Device.StartTimer(new TimeSpan(0, 0, 1), UpdateLabel); await GetfirstPosition(); } else { sw.Stop(); TimerBtn.Text = "Start"; TimerBtn.BackgroundColor = Color.Green; await GetSecondPosition(); var elapsed = sw.Elapsed.ToString(@"hh\:mm\:ss"); var page = new NewActivityDriveModal(elapsed, OriginLongitude, OriginLatitude, DestLongtitude, DestLatitude); Navigation.PushModalAsync(page); sw.Reset(); } }
async void ToolbarItem_Activated(object sender, EventArgs e) { var page = new NewActivityDriveModal(_activeDrive); await Navigation.PushModalAsync(page); }