Skip to content
This repository was archived by the owner on Apr 27, 2025. It is now read-only.

Commit 50ba89d

Browse files
committed
Fix handle pin clicked does not work
1 parent d4d4b8a commit 50ba89d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

XFGoogleMapSample/XFGoogleMapSample/PinsPage.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ void SelectedPin_Changed(object sender, SelectedPinChangedEventArgs e)
161161
labelStatus.Text = $"[{time}]SelectedPin changed - {e?.SelectedPin?.Label ?? "nothing"}";
162162
}
163163

164-
async void Map_PinClicked(object sender, PinClickedEventArgs e)
164+
// DO NOT mark async method
165+
// Because Xamarin.Forms.GoogleMaps wait synchronously for this callback returns.
166+
void Map_PinClicked(object sender, PinClickedEventArgs e)
165167
{
166-
await DisplayAlert("Pin Clicked", $"{e.Pin.Label} Clicked.", "Close");
167-
168168
e.Handled = switchHandlePinClicked.IsToggled;
169169

170170
// If you set e.Handled = true,

0 commit comments

Comments
 (0)