Suggested (simple) approach for drawing large numbers of visual elements in WPF?

Posted by Ender on Stack Overflow See other posts from Stack Overflow or by Ender
Published on 2010-04-26T22:21:44Z Indexed on 2010/04/26 22:23 UTC
Read the original article Hit count: 312

Filed under:
|
|
|

I'm writing an interface that features a large (~50000px width) "canvas"-type area that is used to display a lot of data in a fairly novel way. This involves lots of lines, rectangles, and text. The user can scroll around to explore the entire canvas.

At the moment I'm just using a standard Canvas panel with various Shapes placed on it. This is nice and easy to do: construct a shape, assign some coordinates, and attach it to the Canvas. Unfortunately, it's pretty slow (to construct the children, not to do the actual rendering).

I've looked into some alternatives, it's a bit intimidating. I don't need anything fancy - just the ability to efficiently construct and place objects in a coordinate plane. If all I get are lines, colored rectangles, and text, I'll be happy.

Do I need Geometry instances inside of Geometry Groups inside of GeometryDrawings inside of some Panel container?

Note: I'd like to include text and graphics (i.e. colored rectangles) in the same space, if possible.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf