The VBDockingManager control allows you to display your designs in dockable windows:
A design to be displayed can be in one of the four states that are described with the enum " Global.VBDesignDockState ":
- AutoHideButton : Hidden as a button on one of the four sides,
- Docked : docked on one of the four sides,
- Tabbed : as a tab,
- FloatingWindow : as a window that can be moved freely.
The orientation control of Docked- or AutoHideButton state with the enum " Global.VBDesignDockPosition ":
You set these properties in the XAML code as attached properties in VBDesigns . The docking manager itself has the content property VBDesignList, which is a list of VBDesigns.
<vb:VBDockingManager xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vb="http://www.iplus-framework.com/ACFramework/xaml"
FocusView="{Binding MyFocusView}">
<vb:VBDesign VBContent="*InOrderForm"
vb:VBDockingManager.Container="TabItem"
vb:VBDockingManager.DockState="Tabbed"
vb:VBDockingManager.DockPosition="Bottom"
vb:VBDockingManager.IsCloseableBSORoot="False"
vb:VBDockingManager.RibbonBarVisibility="Hidden"
vb:VBDockingManager.WindowSize="0,0"
FocusNames="Lines,Postings" />
<vb:VBDesign VBContent="*Explorer"
vb:VBDockingManager.Container="DockableWindow"
vb:VBDockingManager.DockState="AutoHideButton"
vb:VBDockingManager.DockPosition="Right"
vb:VBDockingManager.IsCloseableBSORoot="False"
vb:VBDockingManager.RibbonBarVisibility="Hidden"
vb:VBDockingManager.WindowSize="400,400" />
</vb:VBDockingManager>
If you specify the DockState = "Tabbed", you must always set "vb: VBDockingManager. Container " to "TabItem". Otherwise always as "DockableWindow".
If you want to display subordinate business objects in VBDesign , you can use the " IsCloseableBSORoot " property to control whether the window can be closed by the user at the top right. With the property " RibbonBarVisibility " you control whether the menu ribbon should be hidden.
With " WindowSize " you define the X / Y size of the window that appears when you move the mouse over the button.
Automatic focus
In the chapter for business objects you can see an example of how you can open a business object in the background and set a filter to display the correct data record. With hierarchical master-detail relationships it can happen that there are many nested VBDockingManagers. There are two special dependency properties so that the correct tabs are opened within the DockingManager nesting when the business object is opened:
- " public string FocusView " in the class VBDockingManager and VBTabControl.
- " public string FocusNames " in the class VBDesign and VBTabItem.
Define a String property on your business object that you then bind to the FocusView dependency property . e.g.
private string _MyFocusView;
public string MyFocusView
{
get { return _MyFocusView; }
set {
if (_MyFocusView != value)
{
_MyFocusView = value;
OnPropertyChanged("MyFocusView");
} }
}
This property stores any character string that specifies what is to be displayed or focused on the user interface.
Let us assume that the design " * InOrderForm " from the XAML example above again consists of a DockingManager that displays two tabs:
<vb:VBDockingManager FocusView="{Binding MyFocusView}">
<vb:VBDesign VBContent="*InOrderLines"
FocusNames="Lines"
vb:VBDockingManager.Container="TabItem"
vb:VBDockingManager.DockState="Tabbed"
vb:VBDockingManager.DockPosition="Bottom" />
<vb:VBDesign VBContent="*InOrderPostings"
FocusNames="Postings"
vb:VBDockingManager.Container="TabItem"
vb:VBDockingManager.DockState="Tabbed"
vb:VBDockingManager.DockPosition="Right" />
</vb:VBDockingManager>
If the MyFocusView now has the value "Postings" , then the tab in the outer docking manager is focused with " * InOrderForm " , because the value appears in the property FocusNames with the comma-separated list "Lines, Postings" .
The inner docking manager then focuses the tab with " * InOrderPostings " because it contains the property FocusNames "Postings" .