XElement the property: Location always th

Hello,
I have two question about how to export my graph to XML, I hope that somebody coul help me:

  1. I’m developing a graph with this class GraphModelNodeData I’d like to export it to XML, Could somebody tell me the best way to do it
  2. I’ve changed the GraphModelNodeData class for GraphModelLinksNodeData and I’m trying to create a XML in the following way:
    var model = GraphDiagram.Model as GraphLinksModel<NodeBase, String, String, RelationShip>;
    if (model == null) return;
    XElement root = model.Save<NodeBase, RelationShip>(“SequentialFunctionChart”, “NodeBase”, “RelationShip”);

And it returns back all the information associated to the graph, but in the XElement the property: Location always the value is “NaN NaN”

tnx

I assume that the Nodes in your Diagram do actually appear where you expect them to be. In other words, that the value of Node.Location is not (NaN, NaN).

In that case, the problem is that the node data Location property (NodeBase.Location in your application) doesn’t have the same value that the corresponding Node does. The way you get that is by using data binding. Perhaps you just forgot to specify the data binding, or perhaps you didn’t make it TwoWay:
. . . go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" . . .

Like most attached properties, this binding only goes on the root visual element of your node’s DataTemplate.

Thank you for your answer, but I’ve added this property and still having the same problem > go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" …

Any other reason why the Location value is NaN… thanks

Many of the samples save (and load) node data information including the Location property.

Are all of the other properties being saved correctly?

I don’t know how else I can help you. I suggest you compare your application with the samples to see what is similar and what is different.