The Compass element makes the whole docking process much easier, faster and precise. Thanks to it you can re-arrange the panes of your working plot within a few seconds by just using drag and drop. The compass menu appears only when the user is dragging a pane, marking the possible docking positions within the root container and the container on which the mouse is currently over.
The menu that marks the docking positions within the container underneath the mouse is called Compass, while the one that marks the possible docking positions within the root container is called RootCompass.
The Compass menu is always shown in the middle of the container you are dragging your panes over. It has five indicators: Left, Top, Right, Bottom and Center, where each one of them points to the respective docking position within this container.
As you can see the Compass is situated in the middle of the container on which your mouse is currently over. In this case the "Output" pane is being dragged over the container that hosts "Server Explorer" and "Toolbox" panes.
The class that represents the Compass element is Telerik.Windows.Controls.Docking.Compass which derives from System.Windows.Controls.Control.
Compass compass = new Compass();
compass.IsBottomIndicatorVisible = false;
compass.IsCenterIndicatorVisible = false;
Dim compass As Compass = New Compass()
compass.IsBottomIndicatorVisible = False
compass.IsCenterIndicatorVisible = False
The compass is a completely stylable control that can be easily customized. To learn more take a look at the Styling the Compass topic.
The RootCompass always marks the possible docking positions in the root docking container. It has four indicators: Left, Top, Right and Bottom, where each one of them points to the respective docking position within the root container.
As you can see the RootCompass is situated in the middle of each of the four sides of the root container. In this case the "Server Explorer" pane is being dragged over the root container.
The class that represents the Compass element is Telerik.Windows.Controls.Docking.RootCompass which derives from Telerik.Windows.Controls.Docking.Compass.
RootCompass rootCompass = new RootCompass();
rootCompass.IsLeftIndicatorVisible = false;
rootCompass.IsRightIndicatorVisible = false;
Dim rootCompass As RootCompass = New RootCompass()
rootCompass.IsLeftIndicatorVisible = False
rootCompass.IsRightIndicatorVisible = False
The root compass is a completely stylable control that can be easily customized. To learn more take a look at the Styling the RootCompass topic.
You can get notified when the Compass and RootCompass are shown via the RadDocking's event PreviewShowCompass. This event can be used for implementation of conditional docking.
public partial class CompassSample : UserControl
radDocking.PreviewShowCompass += new EventHandler<Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs>( radDocking_PreviewShowCompass );
private void radDocking_PreviewShowCompass( object sender, Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs e )
e.Compass.Background = new SolidColorBrush( Colors.Red );
Public Partial Class CompassSample
Public Sub New()
AddHandler radDocking.PreviewShowCompass, AddressOf radDocking_PreviewShowCompass
Private Sub radDocking_PreviewShowCompass(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs)
e.Compass.Background = New SolidColorBrush(Colors.Red)
And the result: