GoXam Drag Drop in sub-view UserControl

I’m evaluating GoXam WPF v1.07 with .NET 3.5 SP1 on VS 2008 SP1, have a question about drag n drop nodes between Palette and Diagram:

Our main application view has been divided into different zones (sub view), each zone shows/hides itself based on user preference. Each zone can have multiple UserControls as it's content.
When one zone contains a UserControl wrapped Palette and another zone defines Diagram also in a UserControl, all visuals for the nodes Model show up correctly, but drag n drop seems not working:
AllowDrop=true is set in the Diagram instance, AllowDragOut is explicitly set to true in the Palette instance, when dragging, it always shows a black cross icon.
When Palette and Diagram control are embeded in different UserControls, anyway to make drag n drop work?
Thanks.

OK, it’s good that you have checked that Diagram.AllowDrop is true. Is Diagram.AllowInsert also true? Is Diagram.IsReadOnly false?

Are the IDiagramModel.DataFormat values for both the source Palette and the target Diagram the same? Or are the node data types (IDiagramModel.GetNodeType()) the same?

All double checked: Diagram.AllowDrop=true, Diagram.AllowInsert=true, Diagram.IsReadOnly=false. And both Palette and Diagram’s Model has the same type:
GraphLinksModel<PaletteNodeVM, String, String, PaletteLinkVM>.

Also tried type GraphLinksModel<PaletteNodeVM, String>, still same behavior: when dragging, it always shows black cross icon.
Any other place to check?

Additional info: if I bind the Diagram.Model to the same instance of GraphLinksModel<PaletteNodeVM, String, String, PaletteLinkVM>, both Palette and Diagram shows up the same data based on their own Layout and DateTemplate, but still no drag n drop!

Does this mean both Palette and Diagram needs to share the same visual parent in order to make drag n drop work? Any workaround?

Is your application running with full trust, as a typical desktop application?
(An XBAP running with typical permissions does not support Windows drag-and-drop, so our implementation of drag/drop is limited to one window.)

Are your Diagrams running in separate top-level windows of the same application (AppDomain)?

We’ll investigate.

I just modified an existing application to create a second Window containing a Diagram that was initialized with a new instance of the same kind of model as the main diagram. And I set AllowDrop=true and model.Modifiable=true.

This window/Diagram worked fine as a drag-and-drop target.

Actually, to be more precise, it worked fine until I tried dragging a selection that included links. I wondered why that was, until I noticed a message in the trace listener (the Visual Studio Output window) that it couldn’t add a link data to the model because the LinksSource value wasn’t an IList.

That’s because I had forgotten to initialize the GraphLinksModel.LinksSource collection. Once it had a collection (I used ObservableCollection) everything worked well.

So I suggest you look at the Output window in Visual Studio to see if there are any interesting messages.

Thanks a lot for your help, walter.

I tried to compile your sample GoXamWPFDemo, logicCircuit view's drag-n-drop works correctly. Then I take the logicCircuit.xaml and put it into my project, create instance of it, add the instance to one of my zone container, then the drag n drop stops working. (always black cross icon when dragging).
I assume there must be some conflicts between my visual zone-divided framework and GoXam's drag n drop support. I start to think about to implement the drag n drop by myself.
Now my own dragging part starts to work, the palette node visual start to show while draging from palette zone over another diagram zone. Could you please give me some high level guidlines of the dropping function? like best practice and what interface to implement, which function to call, etc.?
Thank you once again.

I don’t understand what you are asking for.

Do you want to be able to drag from your own Control to a Diagram? If so, and if you want to use the standard drag-and-drop implementation, make sure that the data being transferred is either an instance of the model’s NodeType or an instance of the model’s DataCollection.

If you want to customize the data that is dragged out from a Diagram, override the DraggingTool.DoDragDrop method. The data is normally a new DataObject using the model.DataFormat and the IDataCollection being copied.

yes, I’m trying to drag from my own control to a Diagram.

Thanks for your help.