Graph# Drag&Drop

Oct 29, 2013 at 7:39 AM
Hi,

can anybody help me, how to implement Drag&Drop for nodes in graph#?

Thanks a lot:
KovRobert
Oct 29, 2013 at 8:28 AM
Hi, as i remember they are already implemented using attached properties in DragBehaviour class.
You can edit them in the VertexControl template using smth like this:
xmlns:extbehaviour="clr-namespace:WPFExtensions.AttachedBehaviours;assembly=WPFExtensions"

        <Setter Property="extbehaviour:DragBehaviour.IsDragEnabled"
                Value="True" />
        <Setter Property="extbehaviour:DragBehaviour.X"
                Value="{Binding RelativeSource={RelativeSource Self},Path=(Controls:GraphCanvas.X),Mode=TwoWay}" />
        <Setter Property="extbehaviour:DragBehaviour.Y"
                Value="{Binding RelativeSource={RelativeSource Self},Path=(Controls:GraphCanvas.Y),Mode=TwoWay}" />
Also you can take a look at http://graphx.codeplex.com
This is my enchancement of Graph# project.
Marked as answer by kovrobert on 10/29/2013 at 11:43 AM
Oct 29, 2013 at 12:36 PM
Hi,

thank you for your answer, it was very helpful.

The other project is also great. In the near future i want to use that. :)

Thanks:
KovRobert.