In order to support this new feature, the Module Detail XAML code needed to be updated to support a new TabControl and TabItem Class. The TabControl will be replaced with either AB_DockingTabControl or AB_TabControl and TabItem will be replaced with AB_Tab. The decision to replace TabControl with either AB_DockingTabControl or AB_TabControl depends on whether you want to use this new float/docking enhancement. The decision of what control to use is stored in your Standards Configuration. The Upgrade Utility and the Generation Wizards will pull from this standards configuration to decide which control to use. Before you use the Upgrade Utility, make sure to set the System Configuration to your desired setting. The default is to use the Docking control which will scrub your detail XAML and replace TabControl with AB_DockingTabControl.

The new tab control types are AB_TabControl and AB_DockingTabControl.  The AB_TabControl inherits from the WPF TabControl and the AB_DockingTabControl inherits from the Dragablz tab control.

Scrub Program Code Changes:

The scrub program will upgrade a module's existing generated code to use one of the new Tab Control types. The scrub program does the following steps to update any existing code.

  • Adds an app.config setting for Module.TabControl.AssemblyName and Module.TabControl.ClassName
  • If docking tabs are selected it will add a reference to the Dragablz.dll to every WPF module project
  • WPF Detail.xaml changes
    • Docking Tab changes
      • AB_Tab, AB_TabItem, TabItem all get converted to AB_DockingTabItem
      • Style attribute is removed from AB_DockingTabItem
    • Standard Tab changes
      • AB_Tab, AB_DockingTabItem, TabItem all get converted to AB_TabItem
      • Style attribute is removed from AB_TabItem
  • WPF Detail.xaml.cs changes
    • ap_MainTabControl.ap_Tabs has been changed to ap_MainTabControl.ap_TabItems
  • WPF ContentWindow.xaml.cs changes
    • ap_SubBrowserTabControl.ap_Tabs has been changed to ap_SubBrowserTabControl.ap_TabItems
    • am_SubBrowsersCreated(ObservableCollection<AB_Tab> has been changed to am_SubBrowsersCreated(ObservableCollection<AB_TabItem>

Issues when upgrading to AB_DockingTabControl:

The AB_DockingTabItem does not get displayed in the visual tree. Because it is not a part of the visual tree this breaks most bindings using the ElementName.  If the binding is referencing another control that is not a parent of the control you can switch and ElementName binding to use a source of x:Reference.  The x:Reference binding results in the same behavior in most cases as the ElementName but it finds the controls differently.

The AB_DockingTabItems does not inherit the DataContext of the AB_DockingTabControl by default.  For any additional tabs added to a detail at the Main tab control level it is suggested that these tabs be added to the ap_AdditionalTabItemsToSetDataContextOn collection in the am_SetParentProperties method of the code behind for the detailer.  For any child tab controls if the desired DataContext is the ap_CurrentEntity of the detailer than the same method will work, otherwise a binding will need to be set for each TabItem to the desired DataContext for that tab.