Creating custom nodes like Tank

In the sample application piping diagram, can I modify the datatemplate as follows ->
[I am trying to show my UIElement(say for example : Tank) where the Instrument / Process are in the diagram. ]

<go:NodePanel Sizing=“Fixed”
go:LinkPanel.Index="{Binding Path=Data.Index, Mode=TwoWay}"
go:LinkPanel.Fraction="{Binding Path=Data.Fraction, Mode=TwoWay}"
go:LinkPanel.Offset="{Binding Path=Data.Location, Mode=TwoWay}"
<ContentControl x:Name=“Shape” Content="{Binding Path=Data.UIElement}" HorizontalContentAlignment=“Stretch” VerticalContentAlignment=“Stretch”
Width="{Binding Path=Data.Width, Mode=TwoWay}"
Height="{Binding Path=Data.Height, Mode=TwoWay}">


Dibyendu Kankalia

Well, you can do that but I do not think it is wise to do so.

The reason is that it appears that you are storing UIElements in your model. I suppose that might be OK in restricted situations, but not in general. For example, how would you save and restore the model to whatever database or file that you are using for persistence?

It is more common to provide all of the UI as XAML resources (perhaps in separate resource assemblies) and then look up the desired one based on some simple information (probably just a string) in your data.

The UI Element will not be stored in database. Model will just have the name of the user control which I need to associate with the Element. The user control will be created dynamically and shown where you are showing the Process / Intrument / Valve. Please see the attached diagram.
I cannot load only the xaml as I need to have animations in it and it will be very hard to have triggers start the animations in silverlight.
Since I have user controls in the diagram, I can start / stop the animations at will.
Thanks and Regards,
Dibyendu Kankalia

The use of UserControls would be just fine – that’s just XAML with some code-behind.
There really isn’t any restriction in what you can include in the visual tree of a Node.