The ContentControls contain the SfTreeView and the SfDiagram. The latter is added programmatically using C# into a ContentControl (in Document mode) and then into the DockingManager. Currently, I am working on the mechanism to drag&drop custom elements (using C#, and not AXML) from the sfTreeView to the sfDiagrams. I followed the TreeViewToDiagram, and the CustomCommand examples, but my code continue without working. I would be extremely grateful if you could provide me with an example that allows me to solve this problem.
I checked out the code you gave me, and though it shed light upon some of my doubts, it has not solved them completely. Now I have some extra ones.
For example, the following lines of code that are within Diagram_DragEnter(object sender, ItemDropEventArgs args) seem to be unnecessary.
object dataObject = (args.Source as
System.Windows.DataObject).GetData(typeof(DragObject));
TreeViewNode treeViewItem = (dataObject as DragObject).Source;
TreeViewItem variable is always null.
Also, this example does not show how to render different nodes depending on the dragged TreeViewItem. In other words, it only inserts blue squares in it. I would appreciate it if you could provide me with a similar example, but that allows me to insert different types of nodes programmatically by dragging them from the sfTreeView. Additionally, I would like to know if it is possible to add a textbox to the nodes, similar to the annotation, but in a custom position.
Regards,
Tomas.