Tool window styling questions

Docking/MDI for WPF Forum

Posted 7 years ago by John Dunn
Version: 16.1.0633
Avatar

A couple of Tool Window question-

- Is it possible to remove the ToolWindow title bar text? Setting ToolWindowContainer.TitleFontSize to a small number does decrease the size but setting it to 0 jumps it back up to the default. I still want a title bar since setting DockSite.ToolWindowsHaveTitleBars doesn't have preferred behavior. 

- Similarly, how would I remove the title bar text when the Tool Window is floating?

- How do I style the tabs when the ToolWindow is floating? ToolWindowContainer.TabControlStyle works when they are docked but doesn't seem to have any affect when the window is floating.

- How do I adjust the color of the ToolWindow when floating? For example, DockingWindowContainerTitleBarBackgroundInactiveBrushKey works when docked but doesn't have any affect when floating.

- How do I remove the ability to maximise the ToolWindows?

Sorry for the flurry of questions but I figured it was easier to just put all this in one post.

Comments (3)

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

Hi John,

1) Maybe you can set Title to a space character or a non-breaking space character.  Other than that, you'd need to restyle ToolWindowContainer, meaning make a new implicit Style for ToolWindow container in your Application.Resources.  I'd recommend starting with our default Style for the control, which you can download form your account on our site if you are a WPF Studio customer.

2) This would need you to probably restyle ToolWindowContainer (like above).  But I'm not sure you can really differentiate whether a ToolWindowContainer is in a floating dock host or not.  It's going to be all or nothing.

3) I assume here you set properties directly on the ToolWindowContainer instance.  You should never do that since containers are transient objects that get created/destroyed as layout changes occur.  What you'd want to do instead is make a global implicit Style for ToolWindowContainer and set the TabItemContainerStyle property to a Style that targets AdvancedTabItem.  If you do that, the updated Style will apply to all instances of ToolWindowContainer tabs.

4) Customizing that brush should work ok but perhaps you didn't do it at the Application.Resources scope?  If you did it at the Window scope, the updated value won't flow to floating windows since they are in a separate WPF Window.

5) You can set the DockSite.FloatingToolWindowContainersHaveMaximizeButtons property to false.


Actipro Software Support

Posted 7 years ago by John Dunn
Avatar

Thanks. A couple of follow ups. 

1. How would I go about setting the text to an empty string? The title bar text appears to be bound to the selected tab title. Is there a way to override that without a complete restyle? [EDIT] - I just made the foreground brush match the background and the text effectively disappeared. Works for me...

3. I had an implicit style set in my UserControl. I moved that to a resource dictionary included in App.xaml and it fixed the style when the windows are floating but broke it for when they were docked. I had to duplicate the style in both places to get it to match. Any idea what's going on there? I am also setting TabControlStyle, not TabItemContainerStyle. Is that correct?

[EDIT 2] I think the issue is that my main window is getting created before the Resource Dictionary is being loaded so the Styles and Key overrides haven't been set. Floating windows get created when I unpersist which happens after the dictionary is loaded. Not sure how to solve that one.

[Modified 7 years ago]

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

Hi John,

1) Correct it is bound to the tool window's Title.  You could set the Title as a blank space string on each tool window.  Note that if you want to leave Titles as is and only update the ToolWindowContainer part, you'd need to retemplate ToolWindowContainer to remove the binding.

3) That doesn't sound right.  If you don't have something overriding it at a lower level, it should flow into Docked containers too.  Just put all your implicit Styles in the Application.Resources and it should be fully loaded then before any Windows open.  It's fine to set TabControlStyle if you want to alter properties on the AdvancedTabControl.  You can get to its ItemContainerStyle there too, which is effectively what TabItemContainerStyle binds to.


Actipro Software Support

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.