Please note that default template doesn't contain highlighting.
Please refer to Showcase app (Themed Graph) to see an example.
Highlight function works through attached properties mechanics and supports 2 types of visual controls:
events are used to track down highlighting time.
static class supports several settings to define how the highlighting exactly works:
- IsHighlightEnabled = true/false - specifies that behavior is enabled and corresponding events are listened.
- HighlightControl = Vertex/Edge/VertexAndEdge – specifies what control types will be affected by highlighting.
- HighlightEdges = In/Out/All – specifies exact edge types affected by highlighting (if any)
- HighlightStrategy – not yet implemented.
- Highlighted – specifies that control has been highlighted. By default it is set automatically but you can change this property directly to manualy control highlighting feature.
Basicaly all you need is to define the settings (if you are not satisfied with default values) and use XAML Style triggers for the property Highlighted, for ex.:
<Trigger Property="local:HighlightBehaviour.Highlighted" Value="True">
<Setter Property="Background" Value="Gold"/>
<Trigger Property="local:HighlightBehaviour.Highlighted" Value="False ">
<Setter Property="Background" Value="#FFE3E3E3"/>
This one will color Background property of the control into Gold color.
: It is possible to change Visibility property of the control on trigger so related controls will be shown/hidden on mouse over (Note that controls must exist for that to happen).
In the terms of performance edge controls are not created automatically though you can do it manually using
and GraphArea. GenerateEdgesForVertex()
to generate all possible edges or edges for specified vertex only. Or you can use additional parameters in a call to
to generate visual edges.