Hi.
Since I have to process a document before printing or saving it as doc or pdf (to convert inlineui to span text), I'm trying to do it all on a backgroundworker to avoid locking UI.
Unfortuntantly I'm getting an exception on the format provider export (wich is called during the background code).
I have a variable with the Raddocument and I'm converting it to xaml using:
the cross-thread exception occours on the line exporter.Export(document, stream);
Is there any way to solve this?
Thanks,
Carlos
Since I have to process a document before printing or saving it as doc or pdf (to convert inlineui to span text), I'm trying to do it all on a backgroundworker to avoid locking UI.
Unfortuntantly I'm getting an exception on the format provider export (wich is called during the background code).
I have a variable with the Raddocument and I'm converting it to xaml using:
public
static
string
GetXamlFormDocument(RadDocument document)
{
IDocumentFormatProvider exporter =
new
XamlFormatProvider();
string
result;
using
(MemoryStream stream =
new
MemoryStream())
{
exporter.Export(document, stream);
stream.Seek(0, SeekOrigin.Begin);
StreamReader reader =
new
StreamReader(stream);
result = reader.ReadToEnd();
}
return
result;
}
the cross-thread exception occours on the line exporter.Export(document, stream);
Is there any way to solve this?
Thanks,
Carlos