How to avoid tab title ellipsizing when increasing tab size

Docking/MDI for WPF Forum

The latest build of this product (v24.1.5) was released 1 month ago, which was before this thread was created.
Posted 8 days ago by Seito Shirata
Version: 18.1.0
Avatar

Hi
I use `ActiproSoftware.Docking.Legacy.Wpf.dll`  18.1.672.0.

I want to increase the size of the document windows tabs.

Specifically, I'm considering displaying only two tabs in the parent container.
I achieve this by changing the `Width` property through Binding.

However, there's one problem: even though there is enough space to display it, when the tab title exceeds the original tab size, an ellipsis (…) is displayed.
I found out that in the latest product versions, this can be avoided by changing properties like `MaxTabExtent`,
but is there a way to solve this issue in the version I am using?

Comments (5)

Posted 8 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I believe in that old version there was a TitleConverter used in the DockingWindow template keyed DockingWindowTabbedMdiDocumentTemplateKey.  If you download our default styles/templates and go to the DockingWindow.xaml file, you'll see where it's pulled in.  The converter was initialized as:

<dockingPrimitives:TitleConverter x:Key="DocumentTitleConverter" Prefix="20" Suffix="15" Patch="..." />

Per that configuration, if the document title is longer than 35 characters, it will insert ellipses.  Unfortunately it looks like the only way to alter that would be to clone and redefine the DockingWindowTabbedMdiDocumentTemplateKey in your Application.Resources, using an updated TitleConverter with larger Prefix and Suffix values.  Or stop using the converter altogether if you don't want ellipses.

That should help you achieve what you want.


Actipro Software Support

Posted 7 days ago by Seito Shirata
Avatar

Thank you for your prompt support!

I confirmed that by redefining the duplicated `DocingWindow.xaml` in the Application Resource as you suggested, and removing the use of `TitleConverter`, the strings are now displayed in full without ellipsizing.

However, there was one issue.
The color change function for the selected tab no longer works, making it unclear which tab is selected.
I may not fully understand the workings of WPF, but is there a way to circumvent this issue?

Posted 7 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Make sure you include the ControlTemplate.Triggers section in your cloned template update, since those are what allow the tab to change state appearance when the mouse is over the tab, the tab is selected, etc.  You can see those near the bottom of the default DockingWindowTabbedMdiDocumentTemplateKey template.


Actipro Software Support

Posted 4 days ago by Seito Shirata
Avatar

Hi

Yes, I am sure to include the triggers.

I found that removing the following styles from the DockingWindow, 

<Setter Property="TabBackground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.TabbedMdiContainerTabItemBackgroundNormalBrushKey}}" />
<Setter Property="TabBorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.TabbedMdiContainerTabItemBorderNormalBrushKey}}" />
<Setter Property="TabBorderThickness" Value="{DynamicResource {x:Static themes:AssetResourceKeys.TabbedMdiContainerTabItemBorderNormalThicknessKey}}" />

which are set when the trigger condition is that the DockingWindow.State is Document and the Workspace.MdiTypeKey matches TabbedMdiHost, worked well.

Was this intended? It seems that the values set here are overriding those set in the ControlTemplate.Triggers section

Answer - Posted 3 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Ordinarily that shouldn't be necessary since everything works out of the box correctly with the default styles/templates.  Trigger Setters normally override default Setters.  However I wonder if with the redefinition of the template, the normal Setter priority order is altered, and perhaps that's what you ran into.  


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.