diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.config b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.config
new file mode 100644
index 0000000..7b30518
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml
new file mode 100644
index 0000000..4a591ab
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml.cs b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml.cs
new file mode 100644
index 0000000..1246511
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/App.xaml.cs
@@ -0,0 +1,11 @@
+using System.Windows;
+
+namespace StencilDiagramElements
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.csproj b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.csproj
new file mode 100644
index 0000000..2f97a94
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.csproj
@@ -0,0 +1,101 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}
+ WinExe
+ StencilDiagramElements
+ StencilDiagramElements
+ v4.6.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.sln b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.sln
new file mode 100644
index 0000000..8e5e72d
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_462.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35209.166
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollapseVisibility_462", "CollapseVisibility_462.csproj", "{E15DB11B-274C-4738-89B9-D2D15A51B8FE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5E712F1A-8FC2-479C-B0F1-918FAA8313B2}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.csproj b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.csproj
new file mode 100644
index 0000000..4f44304
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.csproj
@@ -0,0 +1,113 @@
+
+
+ WinExe
+ net6.0-windows
+ true
+ true
+ False
+ false
+ false
+ StencilDiagramElements
+ StencilDiagramElements
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.sln b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.sln
new file mode 100644
index 0000000..9660c1c
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_60.sln
@@ -0,0 +1,24 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31410.414
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollapseVisibility_60", "CollapseVisibility_60.csproj", "{E15DB11B-274C-4738-89B9-D2D15A51B8FE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5E712F1A-8FC2-479C-B0F1-918FAA8313B2}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.csproj b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.csproj
new file mode 100644
index 0000000..cc85067
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.csproj
@@ -0,0 +1,111 @@
+
+
+ WinExe
+ net8.0-windows
+ true
+ true
+ False
+ false
+ false
+ StencilDiagramElements
+ StencilDiagramElements
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.sln b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.sln
new file mode 100644
index 0000000..b218233
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/CollapseVisibility_80.sln
@@ -0,0 +1,24 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.226.21692
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CollapseVisibility_80", "CollapseVisibility_80.csproj", "{E15DB11B-274C-4738-89B9-D2D15A51B8FE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E15DB11B-274C-4738-89B9-D2D15A51B8FE}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5E712F1A-8FC2-479C-B0F1-918FAA8313B2}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml b/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml
new file mode 100644
index 0000000..0af7dd7
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml.cs b/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml.cs
new file mode 100644
index 0000000..e66a39a
--- /dev/null
+++ b/Samples/Stencil/CollapseVisibility/CollapseVisibility/MainWindow.xaml.cs
@@ -0,0 +1,150 @@
+using Syncfusion.UI.Xaml.Diagram;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Windows;
+
+namespace StencilDiagramElements
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private int nodeIndex = 0;
+ private int connectorIndex = 0;
+ List segmentPoints;
+ public MainWindow()
+ {
+ InitializeComponent();
+
+ diagram.Constraints |= GraphConstraints.Bridging;
+ diagram.Loaded += OnDiagramLoaded;
+
+
+ (diagram.Info as IGraphInfo).ItemAdding += OnItemAdding;
+
+ (diagram.Info as IGraphInfo).ItemDropEvent += MainWindow_ItemDropEvent;
+ (diagram.Info as IGraphInfo).NodeChangedEvent += MainWindow_NodeChangedEvent;
+ }
+
+
+ //Method to update relative position of parent node to child node.
+ private void MainWindow_NodeChangedEvent(object sender, ChangeEventArgs