Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrapping Text and Hyperlinks in Silverlight

Tags:

silverlight

I have a string of text that looks like the following:

Thank you for visiting our site. Please review our rules and policies. 

Importantly, "rules" must be a hyperlink that points to "rules.html". Also, "policies" must be a hyperlink that points to "policies.html". The challenge is, I do not have hardly any real-estate for this text. The text cuts off at the word "Please". If it wasn't for the hyperlinks, I could do the following:

<TextBlock TextWrapping="Wrap" Text="Thank you for visiting our site. Please review our rules and policies." />

However, because of the hyperlinks, I can't figure out how to wrap the text naturally. Can somebody please tell me how to do this?

Thank you!

like image 369
user208662 Avatar asked Sep 25 '10 11:09

user208662


1 Answers

Try this:-

<RichTextBox IsReadOnly="True">
    <Paragraph>Thank you for visiting our site. Please review our
      <Hyperlink NavigateUri="/rules.htm">rules</Hyperlink> and
      <Hyperlink NavigateUri="/policies.htm">policies</Hyperlink>.  
    </Paragraph>
</RichTextBox>

BTW, Don't be put off by the way that looks in Visual Studio Designer at runtime it works.

like image 164
AnthonyWJones Avatar answered Dec 13 '22 03:12

AnthonyWJones