Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag and Drop shape to diagram in WPF version (Read 5819 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Drag and Drop shape to diagram in WPF version
Feb 1st, 2008 at 9:19pm
Print Post  
Hi,

I just downloaded the WPF version and I noticed that the DragDrop event is not existed. I'm wondering how to deal with the drag drop event when a shape is dragged from the palette?
Also, I can't find the Flowcharter sample project in the WPF version.

Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop shape to diagram in WPF version
Reply #1 - Feb 2nd, 2008 at 6:20am
Print Post  
Hi,

The WPF drag-and-drop events are called DragOver and Drop. You can see them handled in the FCDemo sample application in "MainWindow.xaml.cs". The first version of the control will come with the nine samples included in the beta. We are going to port the rest of the samples for the next few releases.

Stoyan
  
Back to top
 
IP Logged
 
Jesarg
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Feb 13th, 2008
Re: Drag and Drop shape to diagram in WPF version
Reply #2 - Feb 13th, 2008 at 4:42pm
Print Post  
I recently downloaded the evaluation version of WpfDiagram, and I'm putting together a demo for my project manager (and some other people) to show how this component might be useful for an upcoming project.

I would appreciate it if you split up the sample code into smaller projects (or at least disjoint sections), as it took forever for me to figure out how to get the drag and drop functionality to work, with much of the necessary code scattered throughout various functions and regions of the absolutely enormous MainWindow.xaml.cs file.

For instance:
1. The statements: [ diagram.AllowDrop = true; diagram.DocumentPlane.AllowDrop = true; ] are all in the AttachEvents() method of the Update region of the MainWindow.xaml.cs file instead of being set in the designer or constructor of the Drag and Drop WpfDiagram.
2.  Instead of putting the drag and drop image and labels into the DragAndDrop.xaml file, they are in the MainWindow.xaml file.  Their event handlers are also hidden in the Action region.

It would be extremely helpful if the code for a single piece of functionality would be all together in one place for me to look at (instead of scattered in random places in a source file that's thousands of lines long).
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop shape to diagram in WPF version
Reply #3 - Feb 14th, 2008 at 5:44am
Print Post  
Indeed it's not easy to find sample code in the demo project. We have some drag-and-drop-specific examples for our Windows Forms control, and we'll port one of them to WPF in the next few days.

Stoyan
  
Back to top
 
IP Logged
 
newUser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Sep 4th, 2008
Re: Drag and Drop shape to diagram in WPF version
Reply #4 - Sep 4th, 2008 at 9:29am
Print Post  
i am a new user of Mindfusion wpfdiagram.i want to know how to drag a shape node from one diagram to another diagram.i went thru d sample code FCDemo,in which there were draggable images in diagram bt no where i could find hw to drag the nodes of 1 diagram into another...plz help me out.
Thanks n Regards.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop shape to diagram in WPF version
Reply #5 - Sep 4th, 2008 at 3:11pm
Print Post  
Handle the NodeModifying event. When you detect that the mouse is close to the diagram borders, call args.CancelDrag() to stop the internal drag operation, and then DragDrop.DoDragDrop() to start the drag operation to the second diagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint