I am trying to add hyperlink in my Xamarin Forms and I get this error:
No method Handle_Tapped with correct signature found on type App.Greet
My xaml code:
<Label LineBreakMode="WordWrap">
<Label.FormattedText>
<FormattedString>
<Span Text="Google">
<Span.GestureRecognizers>
<TapGestureRecognizer Tapped="Handle_Tapped" />
<Span.GestureRecognizers>
</Span>
</FormattedString>
</Label.FormattedText>
</Label>
.cs file:
public async void Handle_Tapped(object sender, EventArgs e)
{
String url = "www.google.com";
await Browser.OpenAsync(new Uri(url), BrowserLaunchMode.SystemPreferred);
}
I restarted visual studio without changing any code, and there is no error now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With