Expander and Ports Misalign


Issue with links to Ports when collapsing an Expander. See picture of initial state, then second picture of collapsed expander. How do I get the links to re-align? Code included below.
The collapsed:
Here is the XAML and code-behind:
<Window x:Class="GoXamBrowser.MainWindow"
Title="MainWindow" Height="350" Width="525">

<Border Name="NodeBorder" BorderBrush="Gray" BorderThickness="2" CornerRadius="3" Background="Aqua"
go:Part.SelectionAdorned="True" go:Part.Resizable="True"
go:Node.FromSpot="AllSides" go:Node.ToSpot="AllSides"
go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">

<go:NodeShape go:NodePanel.Figure="Arrow" Width="10" Height="10" Margin="0" Fill="AliceBlue" Stroke="Black" StrokeThickness="1"
go:Node.PortId="{Binding Path=MyPortID}" go:Node.LinkableFrom="True" go:Node.FromSpot="MiddleRight"/>

<Polygon Fill="Black" Points="8 4 0 8 2 4 0 0" go:LinkPanel.Index="-1"
go:LinkPanel.Alignment="1 0.5" go:LinkPanel.Orientation="Along" />

<go:Diagram Grid.Row="1" x:Name="myDiagram"
NodeTemplate="{StaticResource FieldTemplate}"
LinkTemplate="{StaticResource ReferenceTemplate}"/>

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Northwoods.GoXam;
using Northwoods.GoXam.Model;
namespace GoXamBrowser
/// Interaction logic for MainWindow.xaml

public partial class MainWindow : Window
public MainWindow()
DataContext = new MainModel("Sample");
var model = new GraphLinksModel();
model.Modifiable = true; // let the model be modified
model.NodeKeyPath = "Key"; // use the GraphModelNodeData.Key property
this.myDiagram.Model = model;
this.myDiagram.Layout = new Northwoods.GoXam.Layout.LayeredDigraphLayout();
myDiagram.Model.AddNode(new SampleNode("Main", "ToApple", "ToPear"));
myDiagram.Model.AddNode(new SampleNode("Apple", "foo", "foo2"));
myDiagram.Model.AddNode(new SampleNode("Pear", "bar", "bar2"));
myDiagram.Model.AddLink(myDiagram.Model.FindNodeByKey("Main"), "ToApplePort", myDiagram.Model.FindNodeByKey("Apple"), null);
myDiagram.Model.AddLink(myDiagram.Model.FindNodeByKey("Main"), "ToPearPort", myDiagram.Model.FindNodeByKey("Pear"), null);
public class MainModel
public MainModel(string label) { SharedLabel = label; }
public string SharedLabel { get; set; }
public class SampleNode : GraphLinksModelNodeData
public SampleNode(string name, string comment, string comment2): base(name)
Name = name;
Items = new ObservableCollection { new SampleItem(comment, "B1"), new SampleItem(comment2, "B2") };
public string Name { get; set; }
public ObservableCollection Items { get; set; }
public class SampleItem
public SampleItem(string a, string b) { A = a; B = b; MyPortID = a + "Port"; }
public string A { get; set; }
public string B { get; set; }
public string MyPortID { get; set; }
public class SampleLink : GraphLinksModelLinkData

That looks like a bug – we’ll investigate.