{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-treeview-binding",
  "framework": "wpf",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "treeview-binding",
  "dependencies": [
    "Syncfusion.SfDiagram.WPF"
  ],
  "description": "Diagram with TreeView binding, filtering, and synchronized selection between tree and diagram.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/wpf/llms.txt",
    "skillPack": "syncfusion/wpf-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/wpf/diagram-treeview-binding.md"
  },
  "files": [
    {
      "target": "src/components/diagram-treeview-binding/Diagram.xaml",
      "content": "<UserControl\n    x:Class=\"TreeViewBinding.MainWindow\"\n    xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n    xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n    xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n    xmlns:syncfusion=\"http://schemas.syncfusion.com/wpf\"\n    xmlns:local=\"clr-namespace:TreeViewBinding\"\n    mc:Ignorable=\"d\"\n    d:DesignHeight=\"450\" d:DesignWidth=\"800\">\n\n    <UserControl.DataContext>\n        <local:TreeViewBindingDataSource />\n    </UserControl.DataContext>\n\n    <UserControl.Resources>\n        <ResourceDictionary>\n            <ResourceDictionary.MergedDictionaries>\n                <ResourceDictionary Source=\"/Syncfusion.SfDiagram.WPF;component/Resources/BasicShapes.xaml\" />\n            </ResourceDictionary.MergedDictionaries>\n\n            <Style TargetType=\"syncfusion:Connector\">\n                <Setter Property=\"ConnectorGeometryStyle\">\n                    <Setter.Value>\n                        <Style TargetType=\"Path\">\n                            <Setter Property=\"Stroke\" Value=\"CornflowerBlue\" />\n                            <Setter Property=\"StrokeThickness\" Value=\"1\" />\n                        </Style>\n                    </Setter.Value>\n                </Setter>\n                <Setter Property=\"TargetDecoratorStyle\">\n                    <Setter.Value>\n                        <Style TargetType=\"Path\">\n                            <Setter Property=\"Fill\" Value=\"CornflowerBlue\" />\n                            <Setter Property=\"StrokeThickness\" Value=\"1\" />\n                        </Style>\n                    </Setter.Value>\n                </Setter>\n            </Style>\n\n            <Style TargetType=\"syncfusion:Node\">\n                <Setter Property=\"UnitWidth\" Value=\"135\" />\n                <Setter Property=\"UnitHeight\" Value=\"40\" />\n                <Setter Property=\"Width\" Value=\"135\" />\n                <Setter Property=\"Height\" Value=\"40\" />\n                <Setter Property=\"ShapeStyle\">\n                    <Setter.Value>\n                        <Style TargetType=\"Path\">\n                            <Setter Property=\"Fill\" Value=\"CornflowerBlue\" />\n                            <Setter Property=\"Stretch\" Value=\"Fill\" />\n                            <Setter Property=\"Stroke\" Value=\"WhiteSmoke\" />\n                            <Setter Property=\"StrokeThickness\" Value=\"2\" />\n                        </Style>\n                    </Setter.Value>\n                </Setter>\n                <Setter Property=\"ContentTemplate\">\n                    <Setter.Value>\n                        <DataTemplate>\n                            <Border Width=\"135\" Height=\"40\" VerticalAlignment=\"Center\"\n                                    HorizontalAlignment=\"Center\" BorderBrush=\"Transparent\">\n                                <TextBlock Margin=\"5\" TextWrapping=\"Wrap\" FontSize=\"12\"\n                                           Foreground=\"White\" Background=\"Transparent\"\n                                           Text=\"{Binding Name}\"\n                                           VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" />\n                            </Border>\n                        </DataTemplate>\n                    </Setter.Value>\n                </Setter>\n            </Style>\n            <HierarchicalDataTemplate x:Key=\"treeTemplate\" ItemsSource=\"{Binding SubItems}\">\n                <TextBlock Text=\"{Binding Name}\" />\n            </HierarchicalDataTemplate>\n\n            <!-- Template that renders the name of a node inside the diagram. -->\n            <DataTemplate x:Key=\"EmployeeCardTemplate\">\n                <Border Width=\"135\" Height=\"40\" VerticalAlignment=\"Center\"\n                        HorizontalAlignment=\"Center\" BorderBrush=\"Transparent\">\n                    <TextBlock Margin=\"5\" TextWrapping=\"Wrap\" FontSize=\"12\" Foreground=\"White\"\n                               Background=\"Transparent\" Text=\"{Binding Name}\"\n                               VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" />\n                </Border>\n            </DataTemplate>\n        </ResourceDictionary>\n    </UserControl.Resources>\n\n    <Grid x:Name=\"GridRoot\">\n        <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"250\" />\n            <ColumnDefinition Width=\"*\" />\n        </Grid.ColumnDefinitions>\n        <Grid.RowDefinitions>\n            <RowDefinition Height=\"50\" />\n            <RowDefinition Height=\"9.3*\" />\n        </Grid.RowDefinitions>\n\n        <!-- Property area with the add and delete commands. -->\n        <Grid Grid.ColumnSpan=\"2\" x:Name=\"PropertyRowPanel\">\n            <StackPanel Orientation=\"Horizontal\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Center\">\n                <Button Margin=\"10,0,0,0\" Content=\"Add Node\" Name=\"Add\" Width=\"100\" Height=\"30\"\n                        Command=\"{Binding AddNode}\" IsEnabled=\"{Binding IsAddButtonEnabled}\" />\n                <Button Margin=\"10,0,0,0\" Content=\"Delete Node\" Name=\"Delete\" Width=\"100\" Height=\"30\"\n                        Command=\"{Binding DeleteNode}\" IsEnabled=\"{Binding IsDeleteButtonEnabled}\" />\n            </StackPanel>\n            <TextBlock FontWeight=\"Normal\" FontSize=\"14\" Text=\"SfDiagram Binding With TreeView\"\n                       HorizontalAlignment=\"Right\" VerticalAlignment=\"Center\" />\n        </Grid>\n\n        <!-- The tree view and the diagram share a single items source. -->\n        <syncfusion:SfTreeView HorizontalAlignment=\"Center\"\n                                Margin=\"5\"\n                                VerticalAlignment=\"Stretch\"\n                                Grid.Row=\"1\" Name=\"SfTreeView\"\n                                ItemsSource=\"{Binding Datas}\"\n                                SelectedItem=\"{Binding SelectedItem, Mode=TwoWay}\"\n                                ChildPropertyName=\"SubItems\"\n                                ItemTemplate=\"{StaticResource treeTemplate}\"\n                                ShowRootLines=\"False\"\n                                AutoExpandMode=\"AllNodes\"\n                                IsAnimationEnabled=\"True\" />\n\n        <syncfusion:SfDiagram Grid.Row=\"1\" x:Name=\"Diagram\" Grid.Column=\"1\" Margin=\"5,6,5,8\"\n                              ItemAddedCommand=\"{Binding ItemAddedCommand}\" ItemDeletingCommand=\"{Binding ItemDeletingCommand}\" ItemSelectedCommand=\"{Binding ItemSelectedCommand}\" ItemUnSelectedCommand=\"{Binding ItemUnSelectedCommand}\" Tool=\"{Binding Tool}\" Nodes=\"{Binding Nodes}\" Connectors=\"{Binding Connectors}\" DefaultConnectorType=\"{Binding DefaultConnectorType}\" PageSettings=\"{Binding PageSettings}\" SelectedItems=\"{Binding SelectedItems}\" LayoutManager=\"{Binding LayoutManager}\" DataSourceSettings=\"{Binding DataSourceSettings}\" />\n    </Grid>\n</UserControl>\n"
    }
  ]
}