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

        <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.

Last edited Nov 7, 2013 at 5:42 PM by panthernet, version 4