<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:WpfApplication1"
Title="MainWindow" Height="350" Width="525">
<!-- this data template is applied to any object of type Node -->
<DataTemplate DataType="{x:Type l:Node}">
<!-- node names are editable -->
<TextBox Text="{Binding Name}" />
<!-- this data template is applied to any object of type Connection -->
<DataTemplate DataType="{x:Type l:Connection}">
<!-- dot-notation path bindings -->
<Run Text="{Binding Name}" /><Run Text=":" /><Run Text="{Binding NodeA.Name}" /><Run Text="->" /><Run Text="{Binding NodeB.Name}" />
(<Run Text="{Binding AName}" /><Run Text="->" /><Run Text="{Binding BName}" />)
</Grid.ColumnDefinitions>
<!-- display all the nodes -->
<ItemsControl Grid.Column="0" ItemsSource="{Binding Nodes}" />
<!-- display all the connections -->
<ItemsControl Grid.Column="1" ItemsSource="{Binding Connections}" />