Need to make a comment on this server-side approach. In our situtation, we have a large Silverlight application talking to backend WCF services (hosted in IIS but not on the same port as the SL web site). We need to take rtf content, radDocument xaml content loading from the database and convert it to plain text to show a quick preview of that content in radGridViews. At first we tried to do it on the client Silverlight side but ran into major performance issues when loading the grids because of this conversion. Therefore we decided to try to call a WPF assembly from our WCF layer but we get exceptions that "The calling thread must be STA, because many UI components require this." These exceptions were raised in "Telerik.Windows.Documents.Layout.RadTextMeasurerSL" which I suspect is maybe doing some Arrange or Layout of the text. See attached image for error encountered.
While it would be possible to spin up STA threads to convert this text, it just isn't realistic in a large enterprise application to make blocking calls on our MTA service layer. Not to mention the concurrency issues we'd face with that.
So what do we truly need here? A way to:
- show a quick text preview of the rich text content in radGridViews.
- use the conversion routines in the format providers for rtf and Telerik-specific radDocument xaml but in a manner that does not require a STA thread.
Pending any rewrite of your providers, I'm going to have to rethink what we are trying to accomplish strategically here.