Skip to content

Vertex dragging behavior

Alexander Smirnov edited this page Jul 13, 2016 · 1 revision

< Back to contents >

Last checked against version: 2.1.8

To be able to drag vertexes along the field you can use DragBehaviour in VertexControl template. For ex.: 

<!-- VERTEX DRAGGING CONTROL -->
        <Setter Property="local:DragBehaviour.IsDragEnabled"
                Value="True" />
        <Setter Property="gxl:DragBehaviour.UpdateEdgesOnMove"
                Value="True" />
        <Setter Property="local:DragBehaviour.X"
                Value="{Binding RelativeSource={RelativeSource Self},Path=(local:GraphAreaExample.X),Mode=TwoWay}" />
        <Setter Property="local:DragBehaviour.Y"
                Value="{Binding RelativeSource={RelativeSource Self},Path=(local:GraphAreaExample.Y),Mode=TwoWay}" />


Additional attached properties of DragBehaviour:

  • UpdateEdgesOnMove - specifies that edge routing points should be updated while dragging vertex if any ER algorithm has been used on the layout calculation stage.
  • IsDragging - specifies that control is being dragged.
  • IsTagged - implemented to "tag" controls in a group that for ex. allows to mark or drag such group members with a single action. Example for that feature can be found in the Showcase app.

Also you can set drag mode for all verices at once from code using GraphArea.SetVerticesDrag() method.