Change vertex background with trigger

Sep 14, 2010 at 10:32 AM

Hi there,

i've got a problem when i try to change the background color of a vertex (using the trigger -defined in the source of g#)

i changed the highlightTrigger so that now it becomes active when i press the mouse button (not when i step over a vertex)

and in these following lines i get the value of the new background color from a property inside a class of mine (that's because maybe i just want a red back color one time, then maybe a blue one or a green one..i simply update the HighlightedBackgroundColor property with the new one, so that it can be read every time i click ).

<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" Value="true">
        <Setter Property="Background" Value="{Binding Path=(myNamespace:myClass.HighlightedBackgroundColor)}"/>

the problem is that i'm able to do this only once for every single vertex (tho every new color i choose is correctly passed to HighlightedBackgroundColor) : so when i click on a vertex the background will always use the first color the property had. It looks like the trigger is activated just the first time for every vertex.


any idea?

Sep 17, 2010 at 12:53 PM

problem solved!