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

<UserControl x:Class="Fishbone.Fishbone"
        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:Fishbone">

  <FrameworkElement.Resources>
    <DataTemplate x:Key="NodeTemplate">
      <TextBlock Text="{Binding Path=Data.Text}"
                 FontSize="{Binding Path=Data.FontSize}"
                 FontWeight="{Binding Path=Data.FontWeight}"
                 Foreground="Black" />
    </DataTemplate>

    <DataTemplate x:Key="FishboneLinkTemplate">
      <go:LinkShape Stroke="Black" StrokeThickness="1">
        <go:Link.Route>
          <local:FishboneRoute />
        </go:Link.Route>
      </go:LinkShape>
    </DataTemplate>

    <DataTemplate x:Key="NormalLinkTemplate">
      <go:LinkShape Stroke="Black" StrokeThickness="1">
        <go:Link.Route>
          <go:Route Routing="Orthogonal" Corner="4" />
        </go:Link.Route>
      </go:LinkShape>
    </DataTemplate>
  </FrameworkElement.Resources>

  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <StackPanel Grid.Row="0" Orientation="Horizontal">
      <TextBlock Text="Tree Layouts: " />
      <Button Content="Fishbone" Click="FishboneButton_Click" />
      <Button Content="Branching" Click="BranchingButton_Click" />
      <Button Content="Normal" Click="NormalButton_Click" />
    </StackPanel>
    <go:Diagram Grid.Row="1" x:Name="myDiagram" Padding="10"
                NodeTemplate="{StaticResource NodeTemplate}"
                Stretch="UniformToFill">
      <go:Diagram.DraggingTool>
        <go:DraggingTool Inclusions="SubTree" />
      </go:Diagram.DraggingTool>
    </go:Diagram>
  </Grid>
</UserControl>
