Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Looking for the ability to restrict movement of DockItems (Read 3836 times)
MavinTech
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 19
Joined: Jul 30th, 2020
Looking for the ability to restrict movement of DockItems
Dec 29th, 2020 at 6:26pm
Print Post  
I've been looking for a way to restrict the movement of docked items. Ex: Only allow them to be tabbed documents or autohide items, not floating items, or perhaps only dock to the top or bottom of the screen.  Also, I would like to not allow the user to hide/close an item.

I found a reference to AllowedDockLocations in some documentation, but can't seem to find any reference as to how to use it.  (https://www.mindfusion.eu/onlinehelp/wpfpack/F_MindFusion_UI_Wpf_DockControl_All...)

I would like to use the functionality of the docking control, but don't want the user to be able to do whatever they want with it.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Looking for the ability to restrict movement of DockItems
Reply #1 - Jan 4th, 2021 at 8:58am
Print Post  
Sorry, AllowedDockLocations was removed when we moved away from fixed five dock locations (now you can create an arbitrary tree structure of dock elements). We'll add some validation events to let you decide what's allowed.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Looking for the ability to restrict movement of DockItems
Reply #2 - Feb 1st, 2021 at 7:38am
Print Post  
This version raises WindowDocking and WindowUndocking events to let you prevent users from docking or undocking -
https://mindfusion.eu/_temp/dock_validate.zip

E.g. prevent users from removing items from tabbed documents area -
Code
Select All
void dockControl_WindowUndocking(object sender, DockValidationEventArgs e)
{
	e.Cancel = e.DockWindow is TabbedDocument;
} 



Prevent users from adding to the tabbed documents area or creating a new one -
Code
Select All
void dockControl_WindowDocking(object sender, DockValidationEventArgs e)
{
	if (e.DockTarget is TabbedDocument &&
		(e.DockType == DockType.AddTab || e.DockType == DockType.Split))
		e.Cancel = true;
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint