How to resize new shape?

Hi. buddy.

I don’t know how to resize my new shpae.

If I try to resize then Border or Panel olny changed.

Please teach me how to resize…

Thanks!


oragine :

resize :



GoDiagramStyle.xaml
------------------------------



<StackPanel go:Node.LocationSpot=“Center” go:Part.SelectionElementName=“Shape” go:Part.SelectionAdorned=“True”
go:Node.RotationAngle="{Binding Path=Data.Angle, Mode=TwoWay}"
go:Node.Rotatable=“True” go:Part.Resizable=“True”
go:Part.ResizeAdornmentTemplate="{StaticResource NodeResizeAdornmentTemplate}"
go:Part.SelectionAdornmentTemplate="{StaticResource NodeSelectionAdornmentTemplate}"
go:Node.Location="{Binding Data.Location, Mode=TwoWay}" >
<ToolTipService.ToolTip>

</ToolTipService.ToolTip>
<TextBlock Style="{StaticResource TextBlockStyle}" Text="{Binding Path=Data.Text, Mode=TwoWay}"
TextWrapping=“Wrap” TextAlignment=“Center” go:Part.TextEditable=“True” />
<go:SpotPanel HorizontalAlignment=“Center”>
<go:NodePanel x:Name=“Shape” Width="{Binding Data.Width, Mode=TwoWay}"
Height="{Binding Data.Height, Mode=TwoWay}" go:Part.Resizable=“True”>



<Path.Fill>

<LinearGradientBrush.GradientStops>






</LinearGradientBrush.GradientStops>

</Path.Fill>


<Path Data=“M0.60000002,37.689999 L0.60000002,0.60000002 L4.7730002,0.60000002 L4.7730002,37.689999 L0.60000002,37.689999 z M25.635035,37.689999 L25.635035,0.60000002 L42.326035,0.60000002 L42.326035,37.689999 L25.635035,37.689999 z M4.7730346,6.1638517 L17.290913,6.1638517 L17.290913,2.4549956 L25.636034,9.8733072 L17.290913,17.290218 L17.290913,13.582263 L4.7730346,13.582263 L4.7730346,24.70813 L17.290913,24.70813 L17.290913,20.999176 L25.636034,28.417086 L17.290913,35.834995 L17.290913,32.126041 L4.7730346,32.126041”
Stroke="#FF000000" StrokeThickness=“1.2” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round” Height=“38.29” Canvas.Left=“0.194” Stretch=“Fill” Canvas.Top=“0.173” UseLayoutRounding=“False” Width=“42.926”/>

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




<go:NodePanel go:Part.SelectionElementName=“Shape” go:Part.SelectionAdorned=“True”
go:Node.RotationAngle="{Binding Path=Data.Angle, Mode=TwoWay}"
Width="{Binding Data.Width, Mode=TwoWay}" Height="{Binding Data.Height, Mode=TwoWay}"
go:Node.Rotatable=“True” go:Part.Resizable=“True”
go:Part.ResizeAdornmentTemplate="{StaticResource NodeResizeAdornmentTemplate}"
go:Part.SelectionAdornmentTemplate="{StaticResource NodeSelectionAdornmentTemplate}"
go:Node.Location="{Binding Data.Location, Mode=TwoWay}" >



<Path.Fill>

<LinearGradientBrush.GradientStops>






</LinearGradientBrush.GradientStops>

</Path.Fill>


<Path Data=“M 1.0308,47.802 C 12.567,53.471 29.179,53.471 40.716,47.802 L 40.716,47.802 L 40.716,5.2827 C 29.179,-0.38579 12.568,-0.3858 1.0308,5.2827 L 1.0308,5.2827 L 1.0308,47.802 Z "
Stroke=”#FF000000" StrokeThickness=“2” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round”>


<Path.Fill>

</Path.Fill>

<Path Data=“M 18.747,8.8261 L 22.999,8.8261 L 22.999,4.5741 L 18.747,4.5741 L 18.747,8.8261 Z "
Stroke=”#FF000000" StrokeThickness=“0.72” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round”>


<Path.Fill>

</Path.Fill>

<Path Data=“M 4.5741,28.669 L 8.8261,28.669 L 8.8261,24.417 L 4.5741,24.417 L 4.5741,28.669 Z "
Stroke=”#FF000000" StrokeThickness=“0.72” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round”>


<Path.Fill>

</Path.Fill>

<Path Data=“M 18.747,48.511 L 22.999,48.511 L 22.999,44.259 L 18.747,44.259 L 18.747,48.511 Z "
Stroke=”#FF000000" StrokeThickness=“0.72” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round”>



</go:NodePanel>

In addition to setting go:Part.SelectionElementName=“Shape”, you should also set go:Part.ResizeElementName=“Shape” on the root element of your DataTemplate. If you don’t set this, the ResizingTool will resize the default element, which is the whole Node.

Thanks, walter.

I also solved to used [Viewbox] instead of [Cavas].

but this way have a fault that difficult to compound path…

In my case, I used tool Expression Blend.





<go:NodePanel go:Node.LocationSpot=“Center” go:Part.SelectionElementName=“Shape” go:Part.SelectionAdorned=“True”
go:Node.RotationAngle="{Binding Path=Data.Angle, Mode=TwoWay}"
go:Node.Rotatable=“True” go:Part.Resizable=“True”
VerticalAlignment=“Stretch” HorizontalAlignment=“Stretch”
go:Part.ResizeAdornmentTemplate="{StaticResource NodeResizeAdornmentTemplate}"
go:Part.SelectionAdornmentTemplate="{StaticResource NodeSelectionAdornmentTemplate}"
go:Node.Location="{Binding Data.Location, Mode=TwoWay}" ToolTipService.ToolTip=“Outlet Complex”>

<Path Data=“M30.379999,39.399998 L30.379999,0.60000002 L49.379997,0.60000002 L49.379997,39.399998 L30.379999,39.399998 z M0.60000002,39.399998 L0.60000002,0.60000002 L5.48,0.60000002 L5.48,39.399998 L0.60000002,39.399998 z M5.6699996,33.520485 L20.310001,33.520485 L20.310001,37.399994 L30.07,29.639952 L20.310001,21.879906 L20.310001,25.760441 L5.6699996,25.760441 L5.6699996,14.119861 L20.310001,14.119861 L20.310001,18.000397 L30.07,10.240351 L20.310001,2.4799991 L20.310001,6.3600211 C20.310001,6.3600211 5.6699996,6.3600211 5.6699996,6.3600211 C5.6750026,33.25 5.6699996,33.520485 5.6699996,33.520485 z M5.6699996,33.520485 L20.310001,33.520485 L20.310001,37.399994 L30.07,29.639952 L20.310001,21.879906 L20.310001,25.760441 L5.6699996,25.760441 L5.6699996,14.119861 L20.310001,14.119861 L20.310001,18.000397 L30.07,10.240351 L20.310001,2.4799991 L20.310001,6.3600211 C20.310001,6.3600211 5.6699996,6.3600211 5.6699996,6.3600211 C5.6750026,33.25 5.6699996,33.520485 5.6699996,33.520485 z”
Width=“50” Height=“40” Stroke="#FF000000" StrokeThickness=“1.2” StrokeStartLineCap=“Round”
StrokeEndLineCap=“Round” StrokeDashCap=“Round” StrokeLineJoin=“Round” Stretch=“Fill” UseLayoutRounding=“False”>
<Path.Fill>





</Path.Fill>



</go:NodePanel>