1

I am using the following code i found online,

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/750a654e-b002-4742-8f46-609e93f6ec81

where i can save RichTextBox content to SQL DB but i am unable to use TextRange in my Sliverlight file how do i include? which namespace? if any will that namespace work in Silverlight?

Thank you in advance!!!

  • `TextRange` doesn't exist in Silverlight, what is it you are trying to do? – AnthonyWJones Jun 23 '11 at 21:50
  • @AnthonyWJones: thanks for responding I would like to convert Xaml to rtf and i found many that work in WPF but so far none in Silverlight so how do i convert xaml to rtf? –  Jun 24 '11 at 18:54
  • To get the entire contents of the RichTextBox you can use the `Xaml` property. (I've edited my answer accordingly). However I'm not aware of any non-commercial component that will parse Xaml and convert it to RTF. Must it be RTF, will HTML suffice? – AnthonyWJones Jun 24 '11 at 21:04

1 Answers1

0

There is no support for the TextRange in Silverlight. The closest you'll get is the TextSelection object which merely represents the range of text that the user has selected. You can't manipulate the selection yourself, except by calling SelectAll on the RichTextBox.

Edit

If you just want to access the entire contents a RichTextBox as Xaml then you can use its Xaml property.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306