Topics: Animation and Interactivity, SVG
Jan 26, 2011 at 5:40 PM
Edited Jan 26, 2011 at 5:42 PM


While viewing an svg file in WPF, is it possible to identify the element a user clicks on or drags over within the svg document by id?


Jan 27, 2011 at 12:31 AM


Thanks for the interest.
This initial release is targeting conversion to WPF mainly, and further interaction is not planned for this first release.
So currently, you can only get a clicked event for a hyper-linked object.

After the first release the next will start work on interactivity, which will make it easier to do much of such operations; click, drag etc.

The problem was that, I could not successfully convert the individual Drawing to Visual objects, which allows mouse input, for
very complex or highly nested diagrams. So the drawing graph, defined by the DrawingGroup from the conversion, is currently
rendered as a single Visual.

If further attempt to get this to work failed, I will keep the current lower level (using Drawing and Geometry) for one time conversions that
require high performance and use higher level objects (Shape/Path and Canvas for layers/groups) for this, since these are visuals and have
mouse/keyboard input support.

Best regards,

Jan 27, 2011 at 7:52 AM

Hello Paul, 

How about letting users choose which elements (by id/click) are required for interactivity in the result.
- That way you can optimized everything under them and everything that isn't above them.

Best wishes,

Jan 28, 2011 at 12:44 AM

Hello Danny,
Thanks for the input. I will be looking into it this weekend, and see what could be done.

Currently, the user can use the standard hyper-link support in SVG, which is equivalent to wrapping the object in the HTML a-tag,
and get the click event. The "problem" is that this event is not exposed, and you will have to extend the control to process it.

I will examine the options for this release this weekend and see if we can do something useful for such needs.

I will get back to you soon.

Best regards,