Suggestion to improve diagram

Hi,

Right now I have the above diagram. Right now Whenever I add a new node it is positioned automatically on the screen. I want the position to be exactly there where user has droped that node. Example diagram that matches the scenario is

http://www.goxam.com/2.1/Silverlight5/GoSilverlightDemo.html
Flow Chart

I want my above diagram to behave like flow chart but I don’t know how to fill that Location object.
Please help me to position the objects.

Thanks in advance

What is happening is that when the user adds a node, the Diagram.Layout is invalidated and that layout is performed again, thereby moving the node (and all of the other nodes) according to the layout’s implementation.

If you don’t want to automatically invalidate the layout when a node is added, you can set DiagramLayout.Conditions to be whatever combination of LayoutChange flags that you want. There are examples of setting Conditions="…" in many of the samples in the Demo.

Hi,

I have added this conditional flag but the diagram get messed up initially event though I have set the conditional flag to intialonly

<go:Diagram Model="{Binding Path=GoXamModel,Mode=TwoWay}"
NodeTemplateDictionary="{StaticResource NodeTemplates}" SelectedNode="{Binding SelectedNode,Mode=TwoWay}"
LinkTemplate="{StaticResource LinkTemplate}">
go:Diagram.Layout
<golayout:LayeredDigraphLayout Direction=“90” SetsPortSpots=“True” ConditionFlags=“InitialOnly”
CycleRemoveOption=“DepthFirst”/>
</go:Diagram.Layout>
</go:Diagram>

Here is how it looks intially

I want to make it look like

Please suggest what to do to achieve this result

Thanks

If there’s no link between those two nodes, LayeredDigraphLayout will put those two nodes in the same layer, which (when Direction==90) means horizontally next to each other.

Do you have a TwoWay Binding on Node.Location to some data property? If so, you can initialize the location of those two nodes in your data. You would also need to set LayeredDigraphLayout.Conditions=“None”. This would mean no automatic layout. Presumably you would offer a button or other command for the user to decide when they wanted an explicit layout.

Then when you are loading the model you can see if all of the nodes already have positions. If they do, everything is OK. If some don’t, then you can call Diagram.LayoutDiagram().