How do i convert Xaml to Rtf in silverlight?
Asked Answered
J

2

8

I would like to know how to convert Xaml to Rtf in silverlight.

I am working on RichTextBox and i have the Xaml in hand and i would like to convert it to rtf and save it to the DB.

so how do I convert Xaml to Rtf in Silverlight? (TextRange doesn't work in Silverlight)

Jasperjaspers answered 24/6, 2011 at 18:26 Comment(5)
Can you load the XAML and read it back as RTF?Hopeless
You mean the FlowDocuments generated by WPF's RichTextBox? Is HTML an option, too?Outrush
@Botz3000: no WPF please just Silverlight, many WPF features don't work in Silverlight :(Jasperjaspers
@Gabe: i have the Xaml as text/string yes and now i need to convert it to rtfJasperjaspers
I don't think the Silverlight RTB uses RTF. It sounds like you're saving RTF on a server, so can you send the XAML to the server and use a WPF RTB on the server to load the XAML and read out the RTF?Hopeless
T
0

@Gabe:The WPF RTB does NOT support all the classes defined in SL, so if you try to convert a xaml string generated by SL RTB to a rtf string in a WPF RTB, an System.Windows.Markup.XamlParseException exception may be thrown!

Tymon answered 28/11, 2012 at 1:55 Comment(2)
hmmm interesting isn't Silverlight subset of WPF?Jasperjaspers
@peplamb we may say SL is a simplified version of WPF, but in fact they run in totally deferent frameworks (SL-runtime and .net framework). the codes in SL are rewritten and PATTERNED ON WPF.Tymon
K
1

Did you try NRTFTree? This is a .net lib which can build RTF check it in codeplex. http://www.codeproject.com/KB/string/nrtftree.aspx

Keenankeene answered 24/6, 2011 at 19:49 Comment(0)
T
0

@Gabe:The WPF RTB does NOT support all the classes defined in SL, so if you try to convert a xaml string generated by SL RTB to a rtf string in a WPF RTB, an System.Windows.Markup.XamlParseException exception may be thrown!

Tymon answered 28/11, 2012 at 1:55 Comment(2)
hmmm interesting isn't Silverlight subset of WPF?Jasperjaspers
@peplamb we may say SL is a simplified version of WPF, but in fact they run in totally deferent frameworks (SL-runtime and .net framework). the codes in SL are rewritten and PATTERNED ON WPF.Tymon

© 2022 - 2024 — McMap. All rights reserved.