ToolWindow - Functionality Questions

Docking/MDI for WPF Forum

Posted 10 years ago by Bret Naughton
Version: 10.1.0522
I am currently building a dashboard type application, allowing the user to add windows containing graphs/chart/etc. into the basic work area, (I have the ribbon menu on top) and to be able to reposition and size the individual windows accordingly.
Based on this I have looked at using tool windows, as I like the idea of being able to not only dock to other tool windows, but also to the outer edges of the application. I am also using the inner fill method as the only things I will be presenting to the user will be tool windows. I am also not interested in the auto hide functionality so I have disabled this (at a later date, I may add auto hide tool windows to the application to add other functionality).

Based on the above I have come across a few queries I have concerning possible toolWindow functionality. I have gone through the support forum and sample browser, but unable to find out further answers – apologies if these are basic questions.

1) I would like to be able to identify the current tool window that is currently activated (opened or clicked on). I am using the following XAML to create my toolWindow area:

<docking:DockSite x:Name="dockSite" UseHostedAutoHidePopups="False" ToolWindowsTabPlacement="Top" ClosePerContainer="True" CanToolWindowsRaft="False" CanToolWindowsAutoHide="False" CanDocumentWindowsEditTitles="True">

and then I use the ‘WindowActivatedEvent’ to detect when a user has opened a new tool window or changed focus. On this event I loop through all toolwindow documents and check which one ‘.isSelected’. Unfortunately the .IsSelected seems to be set to true for all tool windows. Is there another method to detect the targeted tool window – a bit like the primaryControlTab way of dong things. The idea is I would like to detect when the tool window is selected and which one, whether the tool window is floating or not.

2)I have set the imageSource for the toolWindow, and I can see this successfully when the toolWindows is ‘tabbed’ (I am allowing the user to group in tabs or docked independently) Is there a way that I can have this icon stay on all the time, for when the toolWindow is docked/tabbed/etc or floating? On the same lines, I would also like to show the ContextImageSource at all times on the toolWindow.

3)Is it possible to allow the user to change the title of the toolWindow when not tabbed? I know this is available when displaying the toolWindow as a tab, but would like to allow the user to change this when docked/floated/etc.

4)Is it possible to change the colour of the tool window title bar – I know this is possible when displayed as a tab, but would like the colour to retain when docked or as a separate tool Window? I am currently using Office2007 theme as default for my ribbon bar/application.

Sorry for all the questions, but deciding at the moment the best presentation method for version 1 of the product I am developing and as to whether the intent as described above is possible


Comments (2)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Bret,

1) First, you should not include the SplitContainer or the ToolWindowContainer in your XAML since they are empty. Just use the DockSite only to start with, unless you add ToolWindows right into the ToolWindowContainer in XAML. Our product will dynamically create SplitContainer and ToolWindowContainers as necessary.

You can use DockSite.ActiveWindow to know which tool window currently contains focus. For documents (i.e. items in a TabbedMdiHost or StandardMdiHost) you can use the PrimaryWindow of the host.

2) We don't currently have an option to always show the tool window tabs. If there is only 1 ToolWindow in a ToolWindowContainer, then the tabs are hidden. We've marked down a TODO item to add an option to always show the tabs.

3) Currently we only support changing the title of DocumentWindows when they are docked in a TabbedMdiHost. ToolWindows don't support title changes, regardless of where they are located. This doesn't prevent you from including content (i.e. a TextBox) in the ToolWindow to change the title though.

4) You can customize the brushes used to render the titlebar. If you look at the Theme Browser in our Sample Browser (under the General tab), you can copy the resource keys and define a new brush that uses the same keys. This is applied to all instances of a ToolWindowContainer though. Finally, you can probably add an implicit Style for ToolWindowContainer that uses the TabTintColor of the SelectedWindow to create a brush for the ToolWindowContainer.TitleBarBackgroundActive/TitleBarBackgroundInactive/etc. Our UIColor class from our shared library can be used to tint towards the specified color.

Actipro Software Support

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Bret,

Just fyi for your #2, we added this feature in previous releases. So you can now control the "single tab behavior" to hide, show, or stretch.

Actipro Software Support

The latest build of this product (v2019.1 build 0686) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.