Articles in this section
Category / Section

How can I detect the dragging operation of the splitter?

1 min read

Dragging operation of the splitter in the TabSplittter control can be detected by the DragStarted and DragCompleted events. These events are handled by the splitter that is fetched from the template of the TabSplitter.


//This code demonstrates how to add the TabSplitter and TabSplitterItem:
<Window x:Class="TabsplitterSample.MainWindow"
        xmlns:x="" xmlns:syncfusion=""
        Title="MainWindow" Height="350" Width="525">
        <syncfusion:TabSplitter Name="tabsplitter">
                    <syncfusion:SplitterPage Header="Tab1"/>
                     <syncfusion:SplitterPage Header="Tab2"/>



//This code demonstrates how to access the events of DragStarted and DragCompleted for the splitter:
using Syncfusion.Windows.Tools.Controls;
namespace TabsplitterSample
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
        public MainWindow()
            tabsplitter.Loaded += new RoutedEventHandler(tabsplitter_Loaded);
        private bool TabSplitterDragging;
        void tabsplitter_Loaded(object sender, RoutedEventArgs e)
// This code shows that the splitter has been taken from the Template of the TabSplitter
           CustomGridSplitter splitter = tabsplitter.Template.FindName("PART_Splitter", tabsplitter) as CustomGridSplitter;
           if (splitter != null)
// This code shows the DragStarted and DragCompleted Events of the splitter
               splitter.DragStarted += new System.Windows.Controls.Primitives.DragStartedEventHandler(splitter_DragStarted);
               splitter.DragCompleted += new System.Windows.Controls.Primitives.DragCompletedEventHandler(splitter_DragCompleted);
        void splitter_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
            TabSplitterDragging = false;
        void splitter_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
            TabSplitterDragging = true;

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment