user
user

Reputation: 1759

No method with correct signature type found in Xamarin Forms

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);
    }

Upvotes: 5

Views: 4728

Answers (1)

user
user

Reputation: 1759

I restarted visual studio without changing any code, and there is no error now

Upvotes: 31

Related Questions