LinkableFrom and Move

Is there a recommended way of making a node linkable and still allowing it to move? I tried the following and getting some inconsistent behavior.

<DataTemplate x:Key="nodeTemplate"> <go:NodePanel go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" > <Rectangle x:Name="card" Fill="Red" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" /> <Image Opacity="1" Cursor="Hand" HorizontalAlignment="Center" VerticalAlignment="Center" Sourcecrosshairs.png" Width="30" Height="30" > </Image> </go:NodePanel> </DataTemplate>
Sometimes it seems to work allowing moves by dragging on the image and links by dragging on the rectangle, but sometimes you can't seem to grab the image and drag and sometimes relationships won't start drawing from the rectangle (zindex doesn't affect the problem). other times it works. How do you recommend having move and link behavior at the same time on a node?

I don’t know why that would be behaving irregularly for you. It’s odd that it’s working at all, because NodePanel.Sizing defaults to “Fixed” but you haven’t specified any Width or Height for the Rectangle.

I suggest setting NodePanel.Sizing=“Auto”, so that the Rectangle surrounds whatever size the Image is. And I suggest adding a Margin to the Image, so that there is always a thin(?) red area of the Rectangle available for linking operations.

Sorry, I left out the width and height in the post, but the problem still remains even with auto size. I have further information on it. It seems like if I drop the node in the upper left hand corner of the link analysis diagram it behaves as you would expect. When you click on the rectangle, it draws links and when you click on the image, it moves the node. If I drag the node all the way to the bottom right hand corner and then try to click on it I get a strange result. It seems like the behavior points where the node expects to see clicks is offset. For example if I drag the node to the far right, I need to click to the right of the image to move the node. If I drag it to the bottom right of the diagram i need to click to the right of the node and past the bottom of the node. Any idea where I should start to look? I suspect I did something to cause this happen, but not sure what could have caused it. Could the diagram somehow be interpretting left mouse down clicks on the node a the wrong position? It’s as if the mouse thinks the node is in a different position than it appears on the screen.

That’s odd.

What platform and version are you using?

What are all of the controls or panels that the Diagram is in?

Admittedly I’m stumped. We are using prism, but the diagram is in a regular old UserControl. The version is 1.1.8.4

I put a MouseLeftButtonDown in my NodePanel on a Border control inside the data template and what is strange is that if click in the upper left hand corner of the border when the node is in the top left corner of the diagram, I get a position of (0, 0) relative to itself. But when I move the node way to the right and click on the Node's border in the upper left hand corner of the node I'm getting negative values returned (this is the border relative to itself!) Any ideas? is there a transform going on inside GoXam or something?
Here is my DataTemplate for the node
<DataTemplate x:Key="nodeTemplate"> <go:NodePanel go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}" Sizing="Auto" > <Border BorderThickness="2" BorderBrush="Beige" MouseLeftButtonDown="OnMouseDownInNode"> <StackPanel Orientation="Horizontal"> <Rectangle Stroke="Black" Fill="Aqua" StrokeThickness="2" Width="100" Height="40" go:Node.LinkableFrom="True" go:Node.LinkableTo="True" /> <Image Margin="-20, 0, 0, 0" Opacity=".5" Cursor="Hand" Source="crosshairs.png" Width="30" Height="30" > </Image> </StackPanel> </Border> </go:NodePanel> </DataTemplate>
Here is my diagram declaration
<Grid x:Name="LayoutRoot" Background="Black"> <go:Diagram x:Name="myDiagram" InitialStretch="Uniform" InitialPosition="0,0" AllowDrop="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Model="{Binding Path=LatDataModel}" dragDrop:RadDragAndDropManager.AllowDrop="True" LatMvvmBridge:Diagram.DropInfo="{Binding DropInfo}" LatMvvmBridge:Diagram.DropQuery="{Binding Path=DropQuery}" NodeTemplate="{StaticResource nodeTemplate}" LinkTemplate="{StaticResource linkTemplate}" Background="{StaticResource Brush.Gray.Light.FiftyPct}" InitialDiagramBoundsSpot="MiddleTop" InitialPanelSpot="MiddleTop" MouseLeftButtonDown="OnMouseDownInDiagram" > </go:Diagram> </Grid>
To clarify again, I can actually mouse down outside the border (outside what the user sees) on the right side of the node once it has been moved say 800 pixels to the right and it will move the node so its as if it is interpreting the mouse down in the wrong spot.
When I created a project from scratch with just a node template and diagram it does not seem to be exhibiting this behavior. just having troble narrowing down the problem

Are you using GoSilverlight?

If so, try using version 1.1.9, or 1.2.2.
Otherwise I have no idea what might be causing the problem.

Going to 1.2.2 fixed the problem!

thanks for the support,
-Mike