<!-- Copyright © Northwoods Software Corporation, 2008-2026. All Rights Reserved. -->

<UserControl x:Class="SwimLanes.SwimLanes"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:go="http://schemas.nwoods.com/GoXam"
    xmlns:local="clr-namespace:SwimLanes">

  <UserControl.Resources>
    <DataTemplate x:Key="NodeTemplate">
      <go:NodePanel Sizing="Auto" go:Part.SelectionAdorned="True"
                    go:Node.Location="{Binding Path=Data.Location, Mode=TwoWay}">
        <go:NodeShape go:NodePanel.Figure="Ellipse"
                      go:Node.PortId="" go:Node.LinkableFrom="True" go:Node.LinkableTo="True"
                      go:Node.FromSpot="MiddleRight" go:Node.ToSpot="MiddleLeft"
                      Fill="{Binding Path=Data.Color}" />
        <TextBlock Text="{Binding Path=Data.Color}" />
      </go:NodePanel>
    </DataTemplate>
    <DataTemplate x:Key="GroupTemplate">
      <Border BorderBrush="Blue" BorderThickness="2"
              Background="{Binding Path=Data.Color}"
              go:Node.LocationElementName="myGroupPanel"
              go:Part.Selectable="False">
        <go:GroupPanel x:Name="myGroupPanel" Padding="5" MinWidth="1000" />
        <go:Group.Layout>
          <go:TreeLayout Angle="0" Arrangement="Horizontal" Path="Default"
                         Conditions="Standard NodeSizeChanged" />
        </go:Group.Layout>
      </Border>
    </DataTemplate>
  </UserControl.Resources>

  <Grid>
    <go:Diagram x:Name="myDiagram" Padding="10"
                NodeTemplate="{StaticResource NodeTemplate}"
                GroupTemplate="{StaticResource GroupTemplate}">
      <go:Diagram.Layout>
        <local:VerticalLayout Conditions="Standard GroupSizeChanged" />
      </go:Diagram.Layout>
    </go:Diagram>
  </Grid>
</UserControl>
