I'm using GraphX for .NET and I'm trying to highlight a vertex when the user clicks on it.
I registered for the VertexSelected
event:
public class MyGraphArea : GraphArea<Node, Edge, MiniFlowGraph>
{
public MyGraphArea()
{
VertexSelected += VertexSelected_MarkVertex;
}
private void VertexSelected_MarkVertex(object sender,VertexSelectedEventArgs args)
{
HighlightBehaviour.SetHighlighted(args.VertexControl, true);
}
}
But nothing happened in the UI. So I tried to add multiple options:
To the constructor I added:
EnableVisualPropsApply = true;
HighlightBehaviour.SetIsHighlightEnabled(this, true);
SetVerticesHighlight(true, GraphControlType.VertexAndEdge);
I also registered to the Loaded
event and added this code:
foreach (var item in VertexList)
HighlightBehaviour.SetIsHighlightEnabled(item.Value, true);
Then I added the line SetVerticesHighlight(true, GraphControlType.VertexAndEdge)
to the VertexSelected
event, just for case.
But nothing happened.
I'm looking at the source code, and I can't find anything else.