Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm at a complete loss. I have a SL4 app that displays a page with one or more panels. Each panel contains different stuff. One panel will always be a chart, but it's the other panels that are problematic. Essentially, they represent user-entered text (including bullted lists), tables, or other info.

At first, I was thinking we could use the new RichTextBox control, but the problem is that it's not *really* a RTF-compatible edit control, so we can't let the user create a RTF file (in MS Word, for example) and then copy its contents to the control. The RichTextBox also doesn't have support for bulleted lists. A workaround to that is to create a web service that accepts the rtf, text, stuffs it into a FlowDocument, and then spits back the appropriate XAML (because that's all the RichTextBox displays), but that won't address the parts of RTF that the FlowDocument doesn't support (which apparently has to be discovered on an as-used basis).

We even considered using XPS documents, but the nature of the XPS document is such that the user has to be cognizant of the page width/height, and more importantly, it also isn't really compatible with the fluidic nature of your typical web page/silverlight layout.

I also considered using PDF, but that requires a completely separate page to display, which breaks the multi-panel page container paradigm that I *MUST* maintain.

To make matters worse, I can't use/recommend any 3rd party controls that require "installation" (like Telerik, Infragistics, etc) because of the security/procurement restrictions of our customer.

Knowing all of that, can someone recommend any alternatives to what I've been dealing with?
Posted

1 solution

I guess I'd combine something like this:
Use ASP.NET to Create Dynamic XAML[^] with IronPython or IronRuby - and if those are unacceptable - F# to create something reasonably dynamic.

You could even skip the xaml generation, and just generate something that can be consumed by the dynamic runtime to create and drive your complex panel.

Update
Ooops - I very nearly forgot this one:
Silverlight rich text editor[^] - seems like it's just made for you John :)

Regards
Espen Harlinn
 
Share this answer
 
v2
Comments
Abhinav S 18-Mar-11 8:04am    
Best possible answer. 5.
Sergey Alexandrovich Kryukov 18-Mar-11 14:23pm    
Espen, something tells me that the dynamic languages won't add anything to the solution (I only used F# and Python, but not Iron). I would agree with your second paragraph: I don't see why creating a flow document of the fly could be a problem (skipping XAML generation is absolutely right thing in this case). Maybe, I don't understand OP's notion of "parts of RTF wich FlowDocument does not support". What are those parts? And the reference is good, I feel it can do the trick. My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900