diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/README.md b/Samples/Stencil/SetAutomationIDForSearchbox/README.md
new file mode 100644
index 00000000..15bec613
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/README.md
@@ -0,0 +1,13 @@
+# Preserving node template while drag and drop
+This repository contains sample which shows how to set the Autoamtion Id for the search box.
+
+__*Documentation*__: https://help.syncfusion.com/wpf/diagram/stencil
+
+## Project pre-requisites
+To run this application, you need to have the below two in your system
+
+* [Visual Studio 2019](https://www.visualstudio.com/wpf-vs)
+* [Syncfusion.SfDiagram.WPF](https://www.nuget.org/packages/Syncfusion.SfDiagram.WPF/) nuget package. To install the package using NuGet Package Manager, refer this [link](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio#nuget-package-manager).
+
+## Deploying and running the sample
+* To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.config b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.config
new file mode 100644
index 00000000..8324aa6f
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml
new file mode 100644
index 00000000..c3b91208
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml.cs b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml.cs
new file mode 100644
index 00000000..c4bf2a1f
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace StencilSample
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml
new file mode 100644
index 00000000..f18196ec
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml.cs b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml.cs
new file mode 100644
index 00000000..3a38de65
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/MainWindow.xaml.cs
@@ -0,0 +1,38 @@
+using Syncfusion.UI.Xaml.Diagram.Stencil;
+using System.Windows;
+using System.Windows.Automation;
+using System.Windows.Controls;
+using System.Xml.Linq;
+
+namespace StencilSample
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+ }
+
+ public class CustomStencil: Stencil
+ {
+ public CustomStencil() : base()
+ {
+
+ }
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ var searchTextBox = this.GetTemplateChild("Part_SearchTextBox") as TextBox;
+ if (searchTextBox != null)
+ {
+ searchTextBox.SetValue(AutomationProperties.AutomationIdProperty, "StencilSearchBox");
+ }
+ }
+ }
+}
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/AssemblyInfo.cs b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..496584d0
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("StencilSample")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("StencilSample")]
+[assembly: AssemblyCopyright("Copyright © 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.Designer.cs b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..2c99bd60
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace StencilSample.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StencilSample.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.resx b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.Designer.cs b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..60fb3ff2
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace StencilSample.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.settings b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.settings
new file mode 100644
index 00000000..033d7a5e
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.csproj b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.csproj
new file mode 100644
index 00000000..02c5cb1b
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.csproj
@@ -0,0 +1,101 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}
+ WinExe
+ StencilSample
+ StencilSample
+ v4.6
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ 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/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.sln b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.sln
new file mode 100644
index 00000000..f8d2e66f
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_462.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34309.116
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StencilSample_462", "StencilSample_462.csproj", "{8C993364-7532-4B73-8D2D-F12A154CB091}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {9531B355-8B46-41DC-9F2D-DE0562DA3943}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_60.csproj b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_60.csproj
new file mode 100644
index 00000000..405f0256
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_60.csproj
@@ -0,0 +1,104 @@
+
+
+ WinExe
+ net6.0-windows
+ true
+ true
+ False
+ false
+ false
+ StencilSample
+ StencilSample
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_60.sln b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_60.sln
new file mode 100644
index 00000000..2d5a0d86
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_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}") = "StencilSample_60", "StencilSample_60.csproj", "{8C993364-7532-4B73-8D2D-F12A154CB091}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {9531B355-8B46-41DC-9F2D-DE0562DA3943}
+ EndGlobalSection
+EndGlobal
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_80.csproj b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_80.csproj
new file mode 100644
index 00000000..b114e0df
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_80.csproj
@@ -0,0 +1,104 @@
+
+
+ WinExe
+ net8.0-windows
+ true
+ true
+ False
+ false
+ false
+ StencilSample
+ StencilSample
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+ TRACE;NET50
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+
+
+
\ No newline at end of file
diff --git a/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_80.sln b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_80.sln
new file mode 100644
index 00000000..03e53ad4
--- /dev/null
+++ b/Samples/Stencil/SetAutomationIDForSearchbox/StencilSample/StencilSample_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}") = "StencilSample_80", "StencilSample_80.csproj", "{8C993364-7532-4B73-8D2D-F12A154CB091}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8C993364-7532-4B73-8D2D-F12A154CB091}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {9531B355-8B46-41DC-9F2D-DE0562DA3943}
+ EndGlobalSection
+EndGlobal