Creating custom nodes like Tank

Hi,
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:Part.LayerName=“Foreground”
go:Part.SelectionElementName=“Shape”
go:Part.SelectionAdorned=“True”
go:Node.LocationSpot=“Center”
go:Part.Resizable=“True”
go:Node.Avoidable=“False”
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}"
go:LinkPanel.Alignment=“Center”>
<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}">

</go:NodePanel>

Thanks,
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.

Hi,
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.