Using custom figures made in xaml

Hi walter

I want to use my custom figures buid in xaml.I want to use these xaml figures instead of Go:NodePanel.Figure=“Rectangle” dynamically.
pls tell me how to do this.

this is the type of xaml figure i want to use instead of goxam’s available figures.

                <Canvas xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="160.26624" Height="38.933376" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
                    <Canvas>
                        <Canvas x:Name="shape3_1j" RenderTransform="1,0,0,1,3,0">
                            <Rectangle RadiusX="0" RadiusY="0" Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="108" Height="10.5" Canvas.Left="0" Canvas.Top="18.7">
                                <Rectangle.Fill>
                                    <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                        <RadialGradientBrush.GradientStops>
                                            <GradientStop Color="#FFB0B0B0" Offset="0" />
                                            <GradientStop Color="#FFBFBFBF" Offset="1" />
                                        </RadialGradientBrush.GradientStops>
                                    </RadialGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Canvas>
                        <Canvas x:Name="shape4_5j" RenderTransform="1,0,0,1,78,-4.47">
                            <Rectangle RadiusX="0" RadiusY="0" Fill="#FF339966" Stroke="#FF404040" StrokeThickness="0.12" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="15" Height="3.81" Canvas.Left="0" Canvas.Top="25.39" />
                        </Canvas>
                        <Canvas x:Name="group5_7h" RenderTransform="1,0,0,1,-3,0">
                            <Canvas x:Name="shape6_h8">
                                <Rectangle RadiusX="0" RadiusY="0" Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="6" Height="10.5" Canvas.Left="0" Canvas.Top="18.7">
                                    <Rectangle.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Canvas>
                            <Canvas x:Name="shapeh7_11" RenderTransform="1,0,0,1,2.0256,-0.375">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                            <Canvas x:Name="shape8h_14" RenderTransform="1,0,0,1,2.0256,-7.875">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                        </Canvas>
                        <Canvas x:Name="grouph9_17" RenderTransform="1,0,0,1,111,0">
                            <Canvas x:Name="shapeh10_18">
                                <Rectangle RadiusX="0" RadiusY="0" Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="6" Height="10.5" Canvas.Left="0" Canvas.Top="18.7">
                                    <Rectangle.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Canvas>
                            <Canvas x:Name="shapeh11_21" RenderTransform="1,0,0,1,2.0256,-0.375">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                            <Canvas x:Name="shape12h_24" RenderTransform="1,0,0,1,2.0256,-7.875">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                        </Canvas>
                        <Canvas x:Name="group13_27h" RenderTransform="1,0,0,1,-3,0">
                            <Canvas x:Name="shape1h4_28">
                                <Rectangle RadiusX="0" RadiusY="0" Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="6" Height="10.5" Canvas.Left="0" Canvas.Top="18.7">
                                    <Rectangle.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Canvas>
                            <Canvas x:Name="shape15h_31" RenderTransform="1,0,0,1,2.0256,-0.375">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                            <Canvas x:Name="shape16h_34" RenderTransform="1,0,0,1,2.0256,-7.875">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                        </Canvas>
                        <Canvas x:Name="group17_3h7" RenderTransform="1,0,0,1,111,0">
                            <Canvas x:Name="shapeh8_38">
                                <Rectangle RadiusX="0" RadiusY="0" Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Width="6" Height="10.5" Canvas.Left="0" Canvas.Top="18.7">
                                    <Rectangle.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Canvas>
                            <Canvas x:Name="shape19h_41" RenderTransform="1,0,0,1,2.0256,-0.375">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                            <Canvas x:Name="shape2h0_44" RenderTransform="1,0,0,1,2.0256,-7.875">
                                <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.64L0.97,29.2 1.95,28.64 1.95,27.51 0.97,26.95 0,27.51 0,28.64z">
                                    <Path.Fill>
                                        <RadialGradientBrush Center="0,0" RadiusX="1" RadiusY="1" GradientOrigin="0,0" SpreadMethod="Pad" Transform="Identity">
                                            <RadialGradientBrush.GradientStops>
                                                <GradientStop Color="#FFB0B0B0" Offset="0" />
                                                <GradientStop Color="#FFBFBFBF" Offset="1" />
                                            </RadialGradientBrush.GradientStops>
                                        </RadialGradientBrush>
                                    </Path.Fill>
                                </Path>
                            </Canvas>
                        </Canvas>
                        <Canvas x:Name="shape21_h47" RenderTransform="1,0,0,1,9,0">
                            <Path Stroke="#FF404040" StrokeThickness="0.12" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M63,26.68L90,26.68 90,19.48 63,19.48 63,26.68" />
                        </Canvas>
                        <Canvas x:Name="shape22_h50" RenderTransform="1,0,0,1,9,-3.6">
                            <Path Fill="#FF404040" Data="M0,29.2L0.78,25.69 47.22,25.69 48,29.2 48,25.3 0,25.3 0,29.2z" />
                            <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,29.2L48,29.2 48,25.3 0,25.3 0,29.2" />
                            <Path Stroke="#FF404040" StrokeThickness="0.1" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,29.2L0.78,25.69 47.22,25.69 48,29.2 48,25.3 0,25.3 0,29.2" />
                        </Canvas>
                        <Canvas x:Name="shape23_h54" RenderTransform="1,0,0,1,75,-1.395">
                            <Path Fill="#FF9A9A9A" Stroke="#FF404040" StrokeThickness="0.12" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" StrokeMiterLimit="3" Data="M0,28.08A1.125,1.125,-180,1,1,2.25,28.08A1.125,1.125,-180,1,1,0,28.08z M3.37,28.08A1.125,1.125,-180,1,1,5.62,28.08A1.125,1.125,-180,1,1,3.37,28.08z M7.87,29.2L10.12,29.2 10.12,26.95 7.87,26.95A1.125,1.125,-180,1,0,7.88,29.2z M10.12,29.2L12.37,29.2A1.125,1.125,-180,0,0,12.37,26.95L10.12,26.95 10.12,29.2z M15.75,29.2L18,29.2 18,26.95 15.75,26.95A1.125,1.125,-180,1,0,15.75,29.2z M18,29.2L20.25,29.2A1.125,1.125,-180,0,0,20.25,26.95L18,26.95 18,29.2z" />
                        </Canvas>
                        <Canvas x:Name="shape24_h56" RenderTransform="1,0,0,1,9,0" />
                    </Canvas>
                </Canvas>

[QUOTE=rgautam]Hi walter

I want to use my custom figures buid in xaml.I want to use these xaml figures instead of Go:NodePanel.Figure=“Rectangle” dynamically.
pls tell me how to do this.

[/quote]

I just pasted all of your XAML into a DataTemplate for a Node in a trivial Silverlight 4 application, and it worked fine, as far as I can tell.

It’s a bit odd to have so many nested Canvases, but that’s OK.

Whenever you use a Canvas as a node template, you have to specify the Width and Height. You did so, so it appeared as I expected.

This xaml is build from visio stencil dynamically thats why it has so many canvas.
But i am not sure how to use it in my datatemplate dynamically??
Pls enlighten me on this.

thanks

I hope i am clear with my question!!

I don’t understand what you are asking about. You can do whatever WPF or Silverlight let you do.

The only “dynamic” thing that is specific to GoXam is how each Diagram has a dictionary of DataTemplates for Nodes (and a separate one for Links and another one for Groups). You can swap templates for a particular Node by changing the node’s data’s Category, which removes the node and re-creates it using the new DataTemplate chosen from the Diagram.NodeTemplateDictionary.

I just want to know how can i use xaml in datatemplates.As you have you have used just now.
If you can give an example how you have used my xaml in datatemplate it would be so nice of you.

Thanks

I just surrounded it with … .

You probably want to surround it with more than that, like with some text in a panel.

[QUOTE=walter]I just surrounded it with … .

You probably want to surround it with more than that, like with some text in a panel.
[/quote]

my question to you is how can i use this datatemplate in this template given below

 <DataTemplate x:Key="Standard">
        <go:SpotPanel Style="{StaticResource SpotPanelStyle}"   go:Part.Rotatable="True"   MouseMove="SpotPanel_MouseMove"
                  go:Node.RotationAngle="{Binding Path= Data.Angle,  Mode=TwoWay}" go:Part.Reshapable="True" go:Part.ResizeAdornmentTemplate="{StaticResource NodeResizeAdornmentTemplate}" 
          go:Node.LocationSpot="Center"
                 go:Part.SelectionAdorned="True"
      go:Part.RotateAdornmentTemplate="{StaticResource NodeRotateAdornmentTemplate}"  
                  go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" 
                  MouseEnter="Node_MouseEnter" MouseLeave="Node_MouseLeave" MouseLeftButtonDown="Node_MouseLeftButtonDown"  >
           
            <go:NodePanel   go:Node.SelectionElementName="Shape" MouseLeftButtonUp="NodePanel_MouseLeftButtonUp" 
                            ToolTipService.ToolTip="{Binding Path=Data.Comments}" LostFocus="NodePanel_LostFocus" MouseMove="NodePanel_MouseMove_1" MouseRightButtonDown="Node_MouseRightButtonDown" 
                            go:Node.LinkableFrom="True" 
                            go:Node.LinkableTo="True" 
                            HorizontalAlignment="Center"
                            go:Node.Resizable="True" 
                            go:Node.LinkableDuplicates="True" 
                            go:Node.LinkableSelfNode="True"
                            go:Node.FromSpot="{Binding Path=Data.FromSpot}"
                            go:Node.ToSpot="{Binding Path=Data.ToSpot}" 
                            Visibility="{Binding Path=Data.Visible, Mode=TwoWay, Converter={StaticResource theBooleanVisibilityConverter}}"
                            >
             
                    <Path       x:Name="Shape" 
                            Style="{StaticResource NodeShapeStyle}" 
                            Cursor="Hand"                            
                            MinHeight="50"
                            MinWidth="100"                        
                        Height="{Binding Path=Data.height, Mode=TwoWay}"
                        Width="{Binding Path=Data.width, Mode=TwoWay}"
                            Fill="{Binding Path=Data.Brush, Mode=TwoWay}"
                            Visibility="{Binding Path=Data.Visible, Mode=TwoWay, Converter={StaticResource theBooleanVisibilityConverter}}">                      

                </Path>

     



                    <TextBlock  Text="{Binding Path=Data.Caption, Mode=TwoWay}" 
                            Foreground="{Binding Path=Data.ForeColor, Mode=TwoWay, Converter={StaticResource theColorBrushConverter}}" 
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"
                            TextWrapping="Wrap"                                 
                            Margin="10" 
                            Cursor="Arrow"
                            go:Node.LinkableFrom="False" 
                            go:Node.LinkableTo="False"
                            go:Part.TextEditable="True"/>

                <TextBlock  Text="{Binding Path=Data.CustomerSignedStatus, Mode=OneWay}"  FontWeight="ExtraBold" FontSize="10" FontFamily="Arial Black" Foreground="Maroon"          
                            HorizontalAlignment="Left" 
                            VerticalAlignment="Top"
                            TextWrapping="Wrap"                                 
                            Margin="3" 
                            Cursor="IBeam"
                            go:Node.LinkableFrom="False" 
                            go:Node.LinkableTo="False"
                            go:Part.TextEditable="False"/>


                <!--<Image Source="/Ganges;component/Images/expiry_icon32.png" Name="StateExpiry"  ToolTipService.ToolTip="StateExpiry" 
                       HorizontalAlignment="Right" go:Part.TextEditable="True" VerticalAlignment="Top" Cursor="Hand" 
                       go:Node.LinkableFrom="False" go:Node.LinkableTo="False" Width="20" Height="20"   
                       Visibility="{Binding Path=Data.ExpiryVisible, Mode=TwoWay, Converter={StaticResource theBooleanVisibilityConverter}}" 
                        >
                    
                </Image>-->
            </go:NodePanel>
          
        </go:SpotPanel>
     
        <!-- A Standard node has four ports, the top incoming only, the
         bottom outgoing only, and the other two support both directions.
         Port appearance depends on the Node.Tag property.
         The FromSpot and ToSpot properties control where the link connects.
         The SpotPanel properties control where the port is positioned. -->
    </DataTemplate>

Do you mean instead of the commented-out Image? Just stick your original XAML in there.

This is xaml figure given below i want to use this xaml figure in the datatemplate given just after this xaml figure.Also make sure this figure must resize.




<Rectangle.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Rectangle.Fill>






<Rectangle.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Rectangle.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>





<Rectangle.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Rectangle.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>





<Rectangle.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Rectangle.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>





<Rectangle.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Rectangle.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>



<Path.Fill>


<RadialGradientBrush.GradientStops>


</RadialGradientBrush.GradientStops>

</Path.Fill>







<Path Fill="#FF9A9A9A" Stroke="#FF404040" StrokeThickness=“0.12”
StrokeStartLineCap=“Round” StrokeEndLineCap=“Round”
StrokeDashCap=“Round” StrokeLineJoin=“Round” StrokeMiterLimit=“3”
Data="M0,28.08A1.125,1.125,-180,1,1,2.25,28.08A1.125,1.125,-180,1,1,0,28.08z

M3.37,28.08A1.125,1.125,-180,1,1,5.62,28.08A1.125,1.125,-180,1,1,3.37,28.08z
M7.87,29.2L10.12,29.2 10.12,26.95
7.87,26.95A1.125,1.125,-180,1,0,7.88,29.2z
M10.12,29.2L12.37,29.2A1.125,1.125,-180,0,0,12.37,26.95L10.12,26.95
10.12,29.2z M15.75,29.2L18,29.2 18,26.95
15.75,26.95A1.125,1.125,-180,1,0,15.75,29.2z
M18,29.2L20.25,29.2A1.125,1.125,-180,0,0,20.25,26.95L18,26.95 18,29.2z"
/>



<go:SpotPanel Style="{StaticResource SpotPanelStyle}" go:Part.Rotatable="True" MouseMove="SpotPanel_MouseMove"

go:Node.RotationAngle="{Binding Path= Data.Angle, Mode=TwoWay}"
go:Part.Reshapable=“True”
go:Part.ResizeAdornmentTemplate="{StaticResource
NodeResizeAdornmentTemplate}"
go:Node.LocationSpot=“Center”
go:Part.SelectionAdorned=“True”
go:Part.RotateAdornmentTemplate="{StaticResource NodeRotateAdornmentTemplate}"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"

MouseEnter=“Node_MouseEnter” MouseLeave=“Node_MouseLeave”
MouseLeftButtonDown=“Node_MouseLeftButtonDown” >

            <go:NodePanel   go:Node.SelectionElementName="Shape" MouseLeftButtonUp="NodePanel_MouseLeftButtonUp" 

ToolTipService.ToolTip="{Binding Path=Data.Comments}"
LostFocus=“NodePanel_LostFocus” MouseMove=“NodePanel_MouseMove_1”
MouseRightButtonDown=“Node_MouseRightButtonDown”
go:Node.LinkableFrom=“True”
go:Node.LinkableTo=“True”
HorizontalAlignment=“Center”
go:Node.Resizable=“True”
go:Node.LinkableDuplicates=“True”
go:Node.LinkableSelfNode=“True”
go:Node.FromSpot="{Binding Path=Data.FromSpot}"
go:Node.ToSpot="{Binding Path=Data.ToSpot}"

Visibility="{Binding Path=Data.Visible, Mode=TwoWay,
Converter={StaticResource theBooleanVisibilityConverter}}"
>

                    <Path       x:Name="Shape" 
                            Style="{StaticResource NodeShapeStyle}" 
                            Cursor="Hand"                            
                            MinHeight="50"
                            MinWidth="100"                        
                        Height="{Binding Path=Data.height, Mode=TwoWay}"
                        Width="{Binding Path=Data.width, Mode=TwoWay}"
                            Fill="{Binding Path=Data.Brush, Mode=TwoWay}"

Visibility="{Binding Path=Data.Visible, Mode=TwoWay,
Converter={StaticResource
theBooleanVisibilityConverter}}">

                </Path>

     



                    <TextBlock  Text="{Binding Path=Data.Caption, Mode=TwoWay}" 

Foreground="{Binding Path=Data.ForeColor, Mode=TwoWay,
Converter={StaticResource theColorBrushConverter}}"
HorizontalAlignment=“Center”
VerticalAlignment=“Center”
TextWrapping=“Wrap”
Margin=“10”
Cursor=“Arrow”
go:Node.LinkableFrom=“False”
go:Node.LinkableTo=“False”
go:Part.TextEditable=“True”/>

            </go:NodePanel>
          
        </go:SpotPanel>
     
     
    </DataTemplate>

All Part or Node attached properties should go on the root element of the DataTemplate.

The major exceptions are the port properties – the Node attached properties whose names start with “Port”, “From”, “To”, or “Linkable”. Those attached properties should go on each FrameworkElement that you want to treat as a port. In particular, you’ll want to set go:Node.PortId.

The other exception is go:Part.TextEditable, which just goes on TextBlocks.

To support resizing, you need to set go:Part.Resizable=“True” and go:Part.ResizeElementName to the name of the FrameworkElement that should be resized.