Cancel the ActiveWindow Change

31 May 20211 minute to read

ActiveWindowChanging event is used to cancel the ActiveWindow change. This event will be triggered before the new window is set as active window, the usage is shown below.

<syncfusion:DockingManager UseDocumentContainer="True"     ActiveWindowChanging="DockingManager_ActiveWindowChanging">            
	 
	<Grid Name="grid1" syncfusion:DockingManager.Header="grid1" syncfusion:DockingManager.State="Document"/>

	<Grid Name="grid2" syncfusion:DockingManager.Header="grid2" syncfusion:DockingManager.State="Document"/>

	<Grid Name="grid3" syncfusion:DockingManager.Header="grid3" syncfusion:DockingManager.State="Document"/>

</syncfusion:DockingManager>
private void DockingManager_ActiveWindowChanging(FrameworkElement sender, Syncfusion.Windows.Tools.Controls.ActiveWindowChangingEventArgs e)
{     
   if (sender.Name == "grid1")     
   {         
     e.Cancel = true;     
   }
}