My data model contains an observable collection. I have two views for this observable collection, one of them is a graph view using GoXAM. I have been using the FlowGrammer sample as the basis for my graph view. Each item in the data model collection is represented by a node in the graph. The links in the graph represent the order of the data in the collection. I have a palette of objects that I want to be able to add to the observable collection in the data model. I want to be able to add the objects from the palette by double clicking on them. This just adds the item to the end of the data list. I also want to insert items into the data list by drag and drop on an existing link or node in the graph which will insert the object into the data model collection in the appropriate place. The drag data when dragging from the palette is not the same data type as my graph nodes. This palette is used by both views so the drag data when dragging from the palette cannot be the same data type as the graph nodes. Once a node is created in the graph I want to be able to move its position in the data model list by drag and drop.
I created a graph view model that monitors the data model collection for changes and then calls a method in the graph model where the appropriate nodes and links are added. I also implemented a custom dragging tool which overrides the DropOnto method. This DropOnto method does not change any of the nodes or links in the graph, it only makes changes to the data model collection. This works great. When I double click on an object in the palette, an item gets added to the end of the data model collection list, the view model gets notified of the change and calls appropriate method in the graph model to change the nodes and links as needed. And it all shows up in the graph. If I move items in the other view, the view model gets notified, makes appropriate changes to nodes and links and it all shows up correct. If I move an item in the graph view, everything in both views looks correct.
The problem is when I override the OnDrop method in the custom dragging tool. I drop an object from the palette and add or insert an item into the data model collection. The graph view model gets notified of the change, calls the appropriate method in the graph model to change the nodes and links as needed. The new node and links do not show up in the graph. The changes to the nodes and links all look correct when I check the graph model NodesSource and LinksSource. They just do not appear in the graph.
Do you have any idea why the nodes do not show up? Thanks!