Hi all,
I'm currently working on a WPF (with C# behind the scenes) system which requires rendering of data from many different files. Most of those files are AutoCAD documents. Each file comes with a set of data that we need to draw on screen essentially on the same canvas. Think of each file as a potential "layer" or overlay that needs to appear on screen.
At the moment, each graphics source is parsed and converted to a set of Path objects. Each collection of paths is rendered to it's own Canvas so that its visibility can be toggled on or off. Each of these canvases is made a child of a parent canvas which has a set of transforms applied to it. Those transforms are basic scale and translate render transforms which are used to support panning and zooming of the image that is being viewed.
This functionality currently works fine, but it's slow. We're rendering quite a few Path objects on screen and loading/creating those Path instances is taking quite a while.
The load speed in itself isn't so much of an issue; what really is the issue is that I need to create the Path instances on the UI thread, otherwise I can't render them all on the same canvas. Hence, while loading, the entire UI is locked up and the user can't do anything.
I have searched extensively on the web but can't seem to find a solution to the problem. I did stumble on one article (unfortunately I don't have the link anymore) which described a method of hosting items created on different threads on the same window. This didn't work for me at all. I tried a combination of things that I found in the article but I couldn't get anything to render at all.
So I guess the crux of my question is: Is it possible to create a set of UI objects, in particular Path objects, on different threads, then load them into a parent canvas on the main UI thread and have them all play nicely together? Any references, articles or tutorials would be greatly appreciated.
I'm looking forward to your help! Thanks for reading.
OJ
Edit 1: Each of the Path instances is just a single line with a colour. They aren't complicated. But it seems that creation of those objects themselves is what is taking the time (I might be wrong). Thanks!