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

<UserControl x:Class="Table.Table"
    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">
  <UserControl.Resources>
    <DataTemplate x:Key="NodeTemplate">
      <Border Background="White" BorderBrush="Brown" BorderThickness="3" CornerRadius="15" Padding="5"
              go:Node.LocationSpot="Center"
              go:Node.FromSpot="AllSides" go:Node.ToSpot="AllSides">
        <StackPanel Orientation="Horizontal">
          <StackPanel>
            <StackPanel Orientation="Horizontal"><TextBlock Text="Key: " /> <TextBlock Text="{Binding Path=Data.Key}" /></StackPanel>
            <StackPanel Orientation="Horizontal"><TextBlock Text="Level: " /> <TextBlock Text="{Binding Path=Data.Level}" /></StackPanel>
            <StackPanel Orientation="Horizontal"><TextBlock Text="Area: " /> <TextBlock Text="{Binding Path=Data.Area}" /></StackPanel>
          </StackPanel>
          <Rectangle Width="30" Height="40" Stroke="Black" StrokeThickness="1" Margin="10 0 0 0" />
        </StackPanel>
      </Border>
    </DataTemplate>

    <go:DataTemplateDictionary x:Key="NodeTemplateDictionary" Default="{StaticResource NodeTemplate}">
      <DataTemplate x:Key="Level">
        <TextBlock Text="{Binding Path=Data.Text}" FontWeight="Bold" go:Part.Selectable="False" />
      </DataTemplate>

      <DataTemplate x:Key="Area">
        <Border Background="Black" Padding="2 0 2 0" go:Part.Selectable="False">
          <TextBlock Text="{Binding Path=Data.Text}" Foreground="White" />
        </Border>
      </DataTemplate>
    </go:DataTemplateDictionary>

    <DataTemplate x:Key="LinkTemplate">
      <go:LinkPanel>
        <go:Link.Route>
          <go:Route Routing="AvoidsNodes" Corner="5" />
        </go:Link.Route>
        <go:LinkShape Stroke="Red" StrokeThickness="2" />
        <Path Fill="Red" go:LinkPanel.ToArrow="Standard" />
      </go:LinkPanel>
    </DataTemplate>
  </UserControl.Resources>
  <Grid>
    <go:Diagram x:Name="myDiagram"
                NodeTemplateDictionary="{StaticResource NodeTemplateDictionary}"
                LinkTemplate="{StaticResource LinkTemplate}">
    </go:Diagram>
  </Grid>
</UserControl>
