-1

I am trying to make an app, and I wanted to have text with hyperlink, but whenever I try to run my app it gives me this error: "Error Position 68:40. Type Hyperlink not found in xmlns http://xamarin.com/schemas/2014/forms FamilyEvents C:\desenv\Family\FamilyEvents\DetailsPage.xaml 68 "

My code is this:

My code

2 Answers2

0

<Hyperlink /> is not a Xamarin Forms control.

You can achieve something similar by using a Label control with a TapGestureRecognizer.

Jason
  • 86,222
  • 15
  • 131
  • 146
0

The type you are using Hyperlink is not a control within Xamarin.Forms, so it gives you an error that it is not a type which is found in the default namespace.

If you want such functionality use a Label control on which you can tap with a TapGestureRecognizer. The code could look like this:

<Label Text="My link">
    <Label.GestureRecognizers>
        <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="1" />
    </Label.GestureRecognizers>
</Label>

And in your code behind implement the OnTapGestureRecognizerTapped event which opens your link.

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100