I have a group of custom shapes for the nodes in my drawing, each consisting of multiple paths, and can’t figure out how to resize the shapes. Here is a sample data template:
<DataTemplate x:Key="shapeTemplate">
<StackPanel go:Part.SelectionElementName="Shape" go:Part.SelectionAdorned="True" go:Part.ResizeElementName="Shape"
go:Node.LocationElementName="Shape" go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">
<go:NodePanel x:Name="Shape" Sizing="Auto" HorizontalAlignment="Center" VerticalAlignment="Center">
<go:NodePanel.ToolTip>
<TextBlock Text="{Binding Path=Data.Text}" />
</go:NodePanel.ToolTip>
<Rectangle Fill="Transparent" />
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 11.521,2.520 L 2.701,11.340"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 3.420,12.061 L 0.180,13.860 L 1.800,10.440 L 3.420,12.061 Z M 0.180,13.860 L 1.800,10.440 L 0.180,13.860 Z"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 0.180,6.839 L 2.880,6.839"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 13.861,6.839 L 11.161,6.839"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 11.880,2.160 L 9.901,3.959"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 2.160,2.160 L 4.140,3.959"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 7.021,0.180 L 7.021,2.879"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 9.901,9.900 L 11.880,11.700"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" Data="F1 M 7.021,13.681 L 7.021,10.980"/>
<Path StrokeThickness="0.4" Stroke="#ff010101" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Bevel" Data="F1 M 7.021,10.800 L 8.460,10.620 L 9.541,9.900 L 10.441,8.820 L 10.981,7.560 L 10.981,6.120 L 10.441,4.860 L 9.541,3.780 L 8.460,3.060 L 7.021,2.879 L 5.580,3.060 L 4.500,3.780 L 3.600,4.860 L 3.060,6.120 L 3.060,7.560 L 3.600,8.820 L 4.500,9.900 L 5.580,10.620 L 7.021,10.800"/>
</go:NodePanel>
</StackPanel>
</DataTemplate>
I’ve tried changing the options on the stretch attribute for each path, but those distort the images into a mess of lines… How can I resize these images properly?
Thanks
Ryan