Rafting window styling

Docking/MDI for WPF Forum

Posted 12 years ago by Samuele Gantner
Version: 12.1.0561
Avatar

Hello,

I've spent the last couple of hours trying to customize three simple things in the rafting window... with absolutely zero success :)

Here is a picture of what I would like to achieve:

1. The border color and thickness
2. The gradient used for the header
3. The height of the header itself

All of this should have 2 different settings, the first for when the window is focused, the second one for when it isn't.

As you notice from the screenshot I did manage to customize the buttons with the style below which I apply by overriding

protected override IRaftingWindow CreateRaftingWindow(RaftingHost raftingHost)

Style for colors:

<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.TabbedMdiContainerTabItemGlyphBackgroundHoverBrushKey}" Color="#828282" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.TabbedMdiContainerTabItemGlyphBackgroundSelectedBrushKey}" Color="#404040" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.TabbedMdiContainerTabControlForegroundNormalBrushKey}" Color="#828282" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonForegroundNormalBrushKey}" Color="#404040" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBackgroundHoverBrushKey}" Color="#DCDFE4" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBorderHoverBrushKey}" Color="#BBBFC6" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonInnerBorderHoverBrushKey}" Color="#DEE2E7" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBackgroundCheckedNormalBrushKey}" Color="#D2DFE4" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBorderCheckedNormalBrushKey}" Color="#B8D1D8" /
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonInnerBorderCheckedNormalBrushKey}" Color="#D0EAF2" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBackgroundPressedBrushKey}" Color="#D2DFE4" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonBorderPressedBrushKey}" Color="#B8D1D8" />
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ToolBarButtonInnerBorderPressedBrushKey}" Color="#D0EAF2" />

Thanks!

Sam

Comments (3)

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

Hi Samuele,

To change the border color you can redefine WorkspaceVeryDarkBackgroundNormalBrushKey to the value you want. And the border's thickness can be set in the CreateRaftingWindow override you made.

The gradient used by the header pulls from two brushes that you can redefine, the inactive one: DockingWindowContainerTitleBarBackgroundInactiveBrushKey, and the active one: DockingWindowContainerTitleBarBackgroundActiveBrushKey.

To change the height of the header you are going to have to create a new implicit style for ToolWindowContainer and put it in your app Resources, then change the Padding property to the desired value.


Actipro Software Support

Posted 12 years ago by Samuele Gantner
Avatar

Hi,

thanks for your reply. So this partially works: the three styles above behave correctly.

The border thickness however does not work. Or more precisely, some border is changed by setting window.BorderThickness, but not the visible 4 pixels border. The effect of changing the border as you described is that the mouse area where the window can be resized grows; but nothing else.

In the end I decided that making the border smaller does not make a lot of sense (this because the border corresponds to the hit are of window resizing).

On the other hand I was wondering if it would be possible to have a standard OS window with a border and header matching the OS settings. Would that require a huge amount of work?

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

Hi Samuele,

Sorry but reverting to a standard looking window won't really work right.  At the moment, depending on the content of the window, we toggle the display of the titlebar.  For instance, in cases where a ToolWindow is in a rafting window by itself, the containing ToolWindowContainer actually renders the titlebar, not the RaftingWindow.  We also have special code for dragging/resizing etc.  So switching back to a native looking window instead of a chrome one would break/change how some of that functions.


Actipro Software Support

The latest build of this product (v24.1.1) 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.