Select to view content in your preferred language

Animate the Graphic (access to GraphicElement?)

720
2
09-19-2013 08:55 AM
Labels (1)
BKuiper
Frequent Contributor
Hi,

i'm trying to replicate the Identify tool as known in ArcMap. A big part is currently implemented, but i'm running into the problem of animating the Graphic when it is selected within my treeview. I don't want to use the IsSelected property on the Graphic to highlight it, but use my own animation/visualstate.

I have looked into getting access to the GraphicElement to assign and start a storyboard, but was unsuccessful to retrieve the GraphicElement through reflection (the GetReferenceElement method and property are internal/private). The element is always null when i retrieve it.

I would like to refrain from creating new ControlTemplates but I think that would probably be the solution ?

Any suggestions/comments on my approach?

Thanks for helping out.

edit: I'm using accelerated display
0 Kudos
2 Replies
BKuiper
Frequent Contributor
I solved the reflection problem

i'm accessing the property instead of the method, which works.

                                PropertyInfo pi = g.GetType().GetProperty("ElementReference", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
                                WeakReference a = pi.GetValue(g, null) as WeakReference;


This should help me to start an animation on the control.
0 Kudos
BKuiper
Frequent Contributor
I solved the reflection problem

i'm accessing the property instead of the method, which works.

                                PropertyInfo pi = g.GetType().GetProperty("ElementReference", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
                                WeakReference a = pi.GetValue(g, null) as WeakReference;


This should help me to start an animation on the control.


It seems that ElementReference is null when AcceleratedDisplay is enabled. For a while I was testing through Remote Desktop and didn't noticed AD was disabled, thus giving me a value.

How can I get the underlying GraphicElement from a Graphic with AcceleratedDisplay enabled ?
0 Kudos