How to disable Preview tabs promotion on TabbedMdiHost?

Docking/MDI for WPF Forum

Posted 8 years ago by Markus Springweiler
Version: 16.1.0631
Avatar

Using Snoop I only found an unbound property named CanTabsPromote on class TabbedMdiContainerTabControl, but while setting it to false via Snoop the promote button disappears, but nothing happens when I include this style:

<Style TargetType="apDocking:TabbedMdiContainerTabControl">
	<Setter Property="CanTabsPromote" Value="False" />
</Style>

Since there is no reference in WPF-16.1.0631-Studio-Styles\Docking.xaml I assume it is being set by code?

If there is an alternative way for placing one tab right aligned this also would be fine.

[Modified 8 years ago]

Comments (6)

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

Hi Markus,

Right now you'd have to target AdvancedTabControl with that Style instead of TabbedMdiContainerTabControl.

We will add a TabbedMdiHost.HasTabPromoteButtons property in the next maintenance release.  Note that the context menu for tabbed MDI still has a Keep Tabs Open item that you'd want to remove via the MenuOpening event.


Actipro Software Support

Posted 8 years ago by Markus Springweiler
Avatar

Is there any automatic included for removing a preview tab or is it up to the application? I noticed having multiple preview tabs open is no problem.

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

It's up to the application since the tab layout kind is just an option. 


Actipro Software Support

Posted 8 years ago by Markus Springweiler
Avatar

I added the following styles and the button is still visible:

<Style TargetType="docking:AdvancedTabControl">
	<Setter Property="CanTabsPromote" Value="False" />
</Style>
<Style TargetType="docking:AdvancedTabItem">
	<Setter Property="CanPromote" Value="False" />
</Style>
Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Sorry, due to how we push down Styles from properties on higher level objects, you'd need to do this instead:

<docking:TabbedMdiHost>
	<docking:TabbedMdiHost.TabControlStyle>
		<Style TargetType="docking:TabbedMdiContainerTabControl">
			<Setter Property="CanTabsPromote" Value="False" />
		</Style>
	</docking:TabbedMdiHost.TabControlStyle>
	...

That will work until the next maintenance release.  Then use the new property instead.


Actipro Software Support

Posted 8 years ago by Markus Springweiler
Avatar

Thank you, this works.

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.