Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best substitute for FlowDocument in Silverlight?

I'm porting an application from WPF to Silverlight and was saddened to read of the lack of FlowDocument support.

What is the best way in Silverlight then to display text with markup?

I just need the basics, e.g.

  • bold
  • italic
  • hyperlink
  • colors
  • font sizes

Added:

I don't mean a RichTextBox (as in the Vectorlight demo) but a way to format text on the application surface itself, like I can do with FlowDocument in WPF:

alt text
(source: deviantsart.com)

like image 948
Edward Tanguay Avatar asked Mar 16 '10 17:03

Edward Tanguay


3 Answers

In Silverlight 3 Vectorlight's Free RichTextBox can do a pretty good job of what you need using HTML.

In Silverlight 4 you have the option of using the RichTextBox to represent your content.

like image 92
AnthonyWJones Avatar answered Oct 21 '22 02:10

AnthonyWJones


If you do get something like that up and running, msg me and maybe we can collaborate on bringing my "BindableFlowDocument" into the world of Silverlight. ;)

edit - wow, I must have gotten mixed up - my original answer was way off

like image 39
JerKimball Avatar answered Oct 21 '22 04:10

JerKimball


Inline with the comments of SL4 RC's RichTextBox (RichTextArea, circa SL4 Beta), and with your example of importing marked up text, the SL4 RC RichTextBox will allow for an import of XAML formatted text - like string richText = MyRichContent.Xaml; on this page: http://timheuer.com/blog/#richtextbox. Details are listed here: http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.xaml(VS.96).aspx.

like image 38
Todd Main Avatar answered Oct 21 '22 03:10

Todd Main