Unique Key

When a node object is dragged from the palette to the diagram, a semi-unique key is generated.

The problem is, the key is not actually unique.
For example:
1. I drag over a node and the key is set to "PAGE"
2. I drag a second node (of the same type) and the new key is "PAGE 1"
3. I delete the PAGE 1 node from the diagram.
4. I drag over a NEW node from the palette (again, of the same type) and I get a key of "PAGE 1"
The problem here is I have other data being generated that uses this key. If the node is deleted and then a new one added, I don't want this data associated with the newly created node. Ideally, this new node (from step #4 above) would get a key of PAGE 2.
Yes, I could delete all the underlying data, but for historical purposes, I never delete, I just mark the data as deleted.
I can add code to deal with all this, but it would be better is to ensure the KEY is truly unique. I know you can do with this with WinForm version of GoDiagram (via the PartID) - is something like this supported in GoXam?
Thanks-
Dave

Try overriding your model’s MakeNodeKeyUnique method.

Ok - I have this working, but it only fires when a dupe key is found. I am experimenting with setting the key to a GUID. However, the first instance of the node does get a GUID because no dupe key is found, thus this event doesn’t fire.

Is there another event I should use that sets the key on the very first instance of a given node being created?

I’m not sure exactly what circumstances you have, but you could override the InsertNode protected method which gets called to actually perform the addition of a new node data to the NodesCollection.

However, I don’t understand if this will satisfy your requirements.