3

I want to use a syncfusion check box in my xamarin.forms project and the text property should contain a hyperlink on a single word block which should be underlined like this:

[ ] By continuing to register an account you agree the "terms and conditions"

The word block "terms and conditions" should be underlined with a hyperlink.

The XAML of the check box looks like this:

<SfCheckBox x:Name="checkBoxIsAgreed" Text="text here"/>

How can I achieve this with only a text property which is a string?

Thanks in advance!

Mr.Sheep
  • 311
  • 3
  • 16
  • Maybe this example of how to do it with a textblock could help you out https://stackoverflow.com/questions/38208741/auto-detect-url-phone-number-email-in-textblock – yawnobleix Jun 17 '19 at 08:10

1 Answers1

1

Better you can separate the text and Checkbox like below.

    <StackLayout Orientation="Vertical">
        <SfCheckBox Text="text here"/>
        <Label>
            <Label.FormattedText>
                <FormattedString>
                    <Span Text="Text Here" />
                    <Span Text="Terms and Conditions" TextDecorations="Underline">
                        <Span.GestureRecognizers>
                            <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
                        </Span.GestureRecognizers>
                    </Span>
                </FormattedString>
            </Label.FormattedText>
        </Label>
    </StackLayout>
VenkyDhana
  • 905
  • 5
  • 16