Styling a Document like a ToolWindow

Docking/MDI for WPF Forum

Posted 8 years ago by Gareth Parris - Software Developer, McLaren
Version: 16.1.0631
Avatar

In the new docking framework. Is it possible to style a document like a toolwindow? We need the document titlebars to take up the full width of each area that it is in with the close button on the right-hand side and have image icons on the left before the title that can be accessed via a context menu.

I've tried substituting tabs for documents and although it almost achieves it we loose the image icon from the window title bar and tabs appear within the document.

We do not want the tabbling behaviour unless the user specifically drags a document onto another. Documents work correctly for us BUT the tab header style is not right. We need each document title to fill the entire width of the display.

We were able to achieve this with the old docking framework (using toolwindows as documents) but now we cannot.

[Modified 8 years ago]

Comments (7)

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

Hi Gareth,

Have you tried using like a maximized standard MDI window setup, or tool window inner fill?  Would either of those suit your needs?

Do you have a screenshot showing what you'd ideally like everything to look like?  The screenshot would definitely be helpful.  Feel free to post a link to one here or you could email it to our support address if you'd prefer to keep it private.

From the Converting to 2016.1 topic, I think this is probably the feature you were referring to that was removed:

SingleTabLayoutBehavior.Stretch Option Removed - The SingleTabLayoutBehavior.Stretch option has been removed. If a similar feature is added in the future, it would be to force all tabs to fill up to the available space instead of just a single tab.

The reason we removed it was that it was odd to have a single tab fill the space and then if two tabs came in, it would suddenly not fill the space.  If we added an option to fill tabs up the available space, how would you like to see that work?


Actipro Software Support

Posted 8 years ago by Gareth Parris - Software Developer, McLaren
Avatar

The standard MDI setup won't work for us as we are committed to the bew docking style for various political reasons.

ToolWindow inner fill does go someway to achieving what we want BUT when we are more than 2 toolwindows they start to tab within themselves. We do not want this inner tabbling behavior as each toolwindow title contains context and actions for its content. When tool windows tab within a container toolwindow the context on the container becomes confusing as we cannot tell what tab it belongs to. Is there a way to stop the tabbing behavior within a tool window? Although we are happy to keep this behavior in the toolwindows that attach to a dockside for auto-hiding.

Posted 8 years ago by Gareth Parris - Software Developer, McLaren
Avatar

Here's a link to an image to explain what we are trying to achieve.

http://www.parris.me.uk/i/actipro.png

That is using tool window inner fill and it does almost achieve what we need. We only have two issues:

1) How do we stop an inner-fill tool window being tabbed. We need be able to restrict specific toolwindow containers to have only 1 toolwindow. Is this possible?

You can see that the right hand side docking tool window does have tabs too. We do want to keep this behavior. We just want to disable it for the inner fill windows.

2) How do we set an icon on the inner-fill tool windows so that it appears to the left of the Title text? I know we can use the customisable toolbar header contents but it does not allow us to set anything to the left of the title.

Here's hoping you can help us!

Thanks,

Gareth.

[Modified 8 years ago]

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

Hi Gareth,

A main question I'd have is that if you didn't show tabstrips, how would you switch between the various windows in the same container?  But per your last post, it seems like you might never want them attachable at all?  If so, you can set DockSite.CanToolWindowsAttach = false.  If you are using a nested DockSite (it looks like you might be), set it on the nested one.  Otherwise, you'd have to set CanAttach = false on each ToolWindow that should have that kind of restriction.

You would also need to retemplate ToolWindowContainer to add the image into the title bar since one doesn't exist in the template right now.  You could use contextual content to show images or status indicators in the title bar without retemplating, but as you saw, they appear on the right next to the title bar buttons.  There's no option to show that content on the left instead, but we could look into adding something (like a ToolWindowTitleContextualContentLocation enum) if that would be helpful to you.


Actipro Software Support

Posted 8 years ago by Gareth Parris - Software Developer, McLaren
Avatar

Ok, for some reason the CanAttach property has passed me by! I've changed our inner nested docksite to set CanToolWindowsAttach="False" and I've also set all the inner tool-windows property <Setter Property="CanAttach" Value="False"/>. 

Now when I add several windows, the first two add as I expect. The third becomes a tab within the second, and same for the rest, they all still become tabs in the second window.

However, now when I drag each tab out of the container it no longer can attach to another one. So it partially works.

How can I stop that initial tabbing?

 

As for the contextual content, we have a working implemetation using that method you suggest but we really need it to be left aligned before the title. If you are able to add an enum to relocate it that would be brilliant!

Thanks,

Gareth.

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

Hi Gareth,

Our next maintenance release will not trigger the tabbing when setting IsOpen=true if the CanAttachResolved property is false.

Also we are adding a DockSite.ToolWindowsTitleBarContextContentAlignment property that you can set to indicate if you want the context content left or right of the title.


Actipro Software Support

Posted 8 years ago by Gareth Parris - Software Developer, McLaren
Avatar

I can confirm that all now works! Thank you.

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.