Saving group model separately and reusing groups as templates

We are evaluating GoXam for one of our project. we have 2 requirements,

  1. User can create some groups diagram and select a particular group for saving. So the output xml should contain only those selected group info. is this possible?
  2. Also like loading palette with nodetemplates, we want to load palette with saved group models (from xml files ( requirement 1)), so that user can drag and drop from palette to canvas as normal palette items.

This is very important requirement for our project, kind of creating diagram templates and reusing in another diagrams (bigger).

Need to know weather is this possible with GoXam?

Thanks.

What I would suggest for the first requirement is to create a new (empty) model and copy the selected group data and its member parts (nodes and links) data into it. Then you can just call Save on the model, as normal.

It is also possible to call MakeXElement directly on the node data, but since you probably want to include the member nodes and links, that might be more tricky.

If you aren’t interested in using the predefined GraphLinksModelNodeData and GraphLinksModelLinkData classes, you’ll need to roll your own persistence mechanism. All of the model data is under your control, so there should be no impediment.

Yes, initializing a Palette is just like initializing any Diagram – just a matter of loading its model. If the contents of the model are coming from separate sources, you’ll need to merge them by copying them into the Palette.Model.