What are your two adornment templates?
Version 1.0 did not support the notion of location (LocationElementName and LocationSpot) in adornments. Version 1.1 will.
That might explain the “off” appearance of the adornments.
<go:SpotPanel d:DesignWidth="128"
d:DesignHeight="112">
<Path go:SpotPanel.Spot="0.0 0.0"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path go:SpotPanel.Spot="0.5 0.0"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path go:SpotPanel.Spot="1.0 0.0"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path go:SpotPanel.Spot="1.0 0.5"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path go:SpotPanel.Spot="0.5 1.0"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path go:SpotPanel.Spot="1.0 1.0"
go:NodePanel.Figure="Rectangle"
Width="6"
Height="6"
Fill="#FFCEDCEC"
Stroke="#FF748EAA"
StrokeThickness="1" />
<Path Stroke="Red"
StrokeThickness="2" />
I have tried your adornment templates and many variations of a NodeTemplate that has a StackPanel centering a shape and an editable TextBlock. All worked as I expected.
The support for Location… within AdornmentTemplates is in v1.1, but not in any of the betas. But since you weren’t depending on that, it doesn’t matter.
BTW, I’m unable to view the video you made because that link (or the web site) isn’t responding.
Hi Walter,
Would you mind posting one of the Data Templates so I could test it?
Mine is not working still.
Thank you,
Pavel
<DataTemplate x:Key="NodeTemplate">
<StackPanel go:Part.SelectionAdorned="True"
go:Part.SelectionElementName="Icon"
go:Part.SelectionAdornmentTemplate="{StaticResource BoxNodeAdornmentTemplate}"
go:Part.ResizeAdornmentTemplate="{StaticResource GroupResizeAdornmentTemplate}"
go:Part.Resizable="True"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}"
go:Node.LocationSpot="BottomLeft"
>
<!--<Ellipse x:Name="Icon" Fill="AliceBlue" Stroke="Gray" Width="50" Height="50" />-->
<go:SpotPanel HorizontalAlignment="Center">
<go:NodePanel Sizing="Fixed">
<Path x:Name="Icon" go:NodePanel.Figure="Circle" Fill="AliceBlue" Stroke="Gray" Width="50" Height="50" />
</go:NodePanel>
<Ellipse go:SpotPanel.Spot="MiddleRight" Fill="Green" Width="10" Height="10" />
</go:SpotPanel>
<TextBlock Text="{Binding Path=Data.Text, Mode=TwoWay}"
HorizontalAlignment="Center"
TextWrapping="Wrap"
MinWidth="10" MinHeight="10" MaxWidth="200"
go:Part.TextEditable="True" />
</StackPanel>
</DataTemplate>
I also tried it with just the simple Ellipse as the “Icon”, instead of the SpotPanel.
I tried both with and without your adornment templates.
I tried with variations on the LocationSpot and LocationElementName.
In each case I selected the node and edited the text several times.