Changes to style keys for dockingThemes

Docking/MDI for WPF Forum

Posted 8 years ago by Ken Elmy
Version: 11.1.0542
Avatar
I've just upgraded the Actipro controls on a project from 2009.1 to 2011.1 (I know a big jump). The app is heavily themed so the first problem I'm running into is changes to style keys and the control templates for these controls, specifically those found in ActiproSoftware.Windows.Controls.Docking.Themes.

Now before I go into the details let me start by saying I've done little more than triage when it comes to theming. The original author of the theme for our app is no longer with us. I am hoping to get the app up and running again with a little triage and then fix any of the new stuff that is unthemed later. And of course I may be going about this the wrong way so by all means please redirect me if there is a better way.

So on to the problem... It looks like the control templates are targeted via a style key -- it's that key that appears to have changed:
  <Style x:Key="{x:Static dockingThemes:DockingCommonDictionary.ToolWindowStyleKey}" TargetType="{x:Type docking:ToolWindow}" BasedOn="{StaticResource {x:Type docking:DockingWindow}}">
    <Setter Property="Background" Value="{DynamicResource {x:Static dockingThemes:DockingCommonDictionary.ToolWindowTabBackgroundNormalBrushKey}}" />
    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static dockingThemes:DockingCommonDictionary.ToolWindowTabBorderNormalBrushKey}}" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Foreground" Value="{DynamicResource {x:Static dockingThemes:DockingCommonDictionary.ToolWindowTabForegroundNormalBrushKey}}" />
    <Setter Property="Margin" Value="0,0,-1,2" />
    <Setter Property="Padding" Value="2,2,4,2" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="docking:ToolWindow">
"ToolWindowStyleKey" is no longer a member of DockingCommonDictionary and I can't find anything similar to it in DockingCommonDictionary. The same goes for:
    TabbedMdiDocumentStyleKey
    StandardMdiDocumentStyleKey
Are there new names for these style keys?

Thanks for the help.

Comments (3)

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

We document any breaking changes in our help file. Please see the Converting from Previous Versions section under Actipro Docking & MDI for more information.

The DocumentWindow and ToolWindow styles were reworked so you could simply use implicit Styles, like with any other WPF control. So you no longer need to base your Styles on ours just to tweak a single property.


Actipro Software Support

Posted 8 years ago by Ken Elmy
Avatar
Thanks for the quick response. What's a help file? :)

So it looks like I need to replace the themed control templates with implicit styles by mining my existing templates for customizations and using them as the basis for the new implicit styles. That's going to be fun...

I do like the new oganization of the styles for these controls though.
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ken,

In general, you should be able to merge your existing Styles into the associated Style trigger.
<Style x:Key="{x:Type docking:ToolWindow}" TargetType="{x:Type docking:ToolWindow}">
    ...
    <Style.Triggers>
        <MultiTrigger>
            <MultiTrigger.Conditions>
                <Condition Property="State" Value="Document" />
                <Condition Property="docking:Workspace.MdiTypeKey" Value="{x:Static docking:TabbedMdiHost.MdiTypeKey}" />
            </MultiTrigger.Conditions>
            <!-- Add same Setters as TabbedMdiDocumentStyleKey Style here -->
        </MultiTrigger>
        <MultiTrigger>
            <MultiTrigger.Conditions>
                <Condition Property="State" Value="Document" />
                <Condition Property="docking:Workspace.MdiTypeKey" Value="{x:Static docking:StandardMdiHost.MdiTypeKey}" />
            </MultiTrigger.Conditions>
            <!-- Add same Setters as StandardMdiDocumentStyleKey Style here -->
        </MultiTrigger>
        <Trigger Property="State" Value="AutoHide">
            <!-- Add same Setters as ToolWindowStyleKey Style here -->
        </Trigger>
        <Trigger Property="State" Value="Docked">
            <!-- Add same Setters as ToolWindowStyleKey Style here -->
        </Trigger>
        <Trigger Property="State" Value="Floating">
            <!-- Add same Setters as ToolWindowStyleKey Style here -->
        </Trigger>
    </Style.Triggers>
</Style>
The AutoHide/Docked/Floating can be set outside of the Triggers also, so they can be grouped. You just need to ensure you override the Setters appropriately in the MDI cases.

This does make things more intuitive and a bit cleaner.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.