Resizing template

Hello,

I want to create a different resizing template, with ellipses instead of rectangles and different colours. I came so far to define the template and display it on the node but as there are no examples on how to get it to work, I’m unable to find out how to get the actual resizing functionality in it.

This is what I have:

<Style x:Key="ResizeAnchorStyle"
       TargetType="Ellipse">
    <Setter Property="Stroke" Value="Green" />
    <Setter Property="Fill" Value="#80008000" />
    <Setter Property="Width" Value="7" />
    <Setter Property="Height" Value="7" />
    <Setter Property="StrokeThickness" Value="1" />
</Style>

<DataTemplate x:Key="ResizeAdornmentTemplate">
    <go:SpotPanel>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="TopLeft"
                 Cursor="SizeNWSE"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="MiddleTop"
                 Cursor="SizeNS"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="TopRight"
                 Cursor="SizeNESW"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="MiddleLeft"
                 Cursor="SizeWE"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="MiddleRight"
                 Cursor="SizeWE"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="BottomLeft"
                 Cursor="SizeNESW"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="MiddleBottom"
                 Cursor="SizeNS"/>
        <Ellipse Style="{StaticResource ResizeAnchorStyle}"
                 go:SpotPanel.Spot="BottomRight"
                 Cursor="SizeNWSE"/>
    </go:SpotPanel>
</DataTemplate>

But of course no resizing happens when I try to click+drag one of the anchor points, only the standard dragselect.

That looks OK to me. Do you set this in the node template?

          go:Part.Resizable="True"
          go:Part.ResizeAdornmentTemplate="{StaticResource ResizeAdornmentTemplate}"

Although you don’t need to set the Cursor, since the ResizingTool will do that automatically. (It has to in case the node is rotated.)

FYI, there are two examples of custom resize Adornment templates – in the Planogram sample and in the Sequential Function sample.

Well, I tried without setting the Cursors but then i was left with the standard pointer, so I thought I need to set them manually. I see, I will check out the samples.

After changing <Ellipse ... /> to <go:ToolHandle ... /> it worked. Thanks.