Hello,
I've got a fairly complex rendering job (e.g. rendering a PDF or HTML file) into a ContentPresenter. I'm trying to do the rendering in a BackgroundWorker. The idea is to do the rendering, which could take some time and not block the UI thread - part of the
rendering includes fetching remote items (e.g. jpgs etc). The plan is to render in the background and once the Canvas is done, add it to a ContentPresenter.
The problem is whenever I create a UIElement (e.g. new Paragraph(), new RichTextBox() etc), I get the dreaded cross thread violation exception. I'm only creating the UIElement (and haven't *added* it to anything in the UI Visual Tree yet) and I still get
this exception.
Could anyone please point me in the derection where I can build visual elements in a background thread and defer additing them to the UI Visual Tree? Is this even possible?
Thanks,
Narayan