Styling a toolwindow container

Docking/MDI for WPF Forum

Posted 8 years ago by Billy Jacobs
Version: 11.1.0542
Avatar
I am trying to change the colors on my MDI Windows, some of which I have done, but I am having some problems.

First, I am dynamically creating the Document Windows and in doing so I am programatically setting the TabBackgroundNormal, TabForegroundNormal, TabBackgroundSelected, TabForegroundSelected properties. However, the TabForegroundSelected will not change from the TabForegroundNormal.

Also, I do not see which property I need to set to change the color of the following:
1. pin button on tool window.
2. down arrow color for menu (float, hide, etc)
3. How do I get rid of the border around the document window?

Also, when I try to create a copy of the template to edit in blend I get the following error: ArgumentException: Type 'System.Char' is not allowed to be an item of DockingWindowControl ...

Thanks,

Billy Jacobs

[Modified at 03/29/2011 10:07 AM]

[Modified at 03/29/2011 10:21 AM]

[Modified at 03/29/2011 04:06 PM]

Comments (10)

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

1. These buttons are represented by either TitleBarButton or TitleBarRepeatButton. So their color is determined by the TitleBarButton.Foreground property. But you may want to set the ForegroundActiveDisabled, ForegroundActiveHover, ForegroundActiveNormal, ForegroundActivePressed, ForegroundInactiveDisabled, ForegroundInactiveHover, and/or ForegroundInactiveNormal properties which are used based on the curren state.

2. This is the same as #1 above.

3. The background should be determined by the DockingWindow.Background property. But again, you may want to set the TabBackgroundHover, TabBackgroundNormal, and TabBackgroundSelected properties instead.

4. Like #3, there are TabForeground properties you can set.

We don't have a "DockingWindowControl" control, so I'm not sure where that error is coming from. But I suspect you have an invalid Style or ControlTemplate.


Actipro Software Support

Posted 8 years ago by Billy Jacobs
Avatar
Where are the TitleBarButton properties located? I cannot find any TitleBarButton in xaml in the ToolwindowContainer or ToolWindow control. Can you provide an example?

Thanks
Posted 8 years ago by Billy Jacobs
Avatar
Where are the TitleBarButton properties located? I cannot find any TitleBarButton in xaml in the ToolwindowContainer or ToolWindow control. Can you provide an example?

Here is my XAML. I am creating the toolwindows and documentwindows programatically.

                    <docking:DockSite x:Name="_dockSite" Background="Transparent"  Grid.Row="1" CanDocumentWindowsRaft="True" SnapsToDevicePixels="True" Foreground="White" >
                        <docking:SplitContainer >
                            <docking:ToolWindowContainer x:Name="_sourceItemsToolWindowContainer" TitleBarForegroundActive="White" TitleBarForegroundInactive="White" TitleBarBackgroundActive="{DynamicResource VSBackgroundBrush}" TitleBarBackgroundInactive="{DynamicResource VSBackgroundBrush}" SnapsToDevicePixels="True" docking:DockSite.ControlSize="300,500" />
                            <docking:Workspace Background="Transparent">
                                <docking:TabbedMdiHost x:Name="_tabbedMDIHost" SnapsToDevicePixels="True" Background="{DynamicResource VSBackgroundBrush}" Foreground="White" TabPlacement="Top" IsCloseButtonOnTab="True" TabOverflowBehavior="ScrollWithMenu">
                                    <docking:TabbedMdiContainer BorderThickness="0" SnapsToDevicePixels="True">
                                        
                                    </docking:TabbedMdiContainer>
                                </docking:TabbedMdiHost>
                            </docking:Workspace>
                            <docking:ToolWindowContainer x:Name="_alertItemsToolWindowContainer" TitleBarForegroundActive="White" TitleBarForegroundInactive="White" TitleBarBackgroundActive="{DynamicResource VSBackgroundBrush}" TitleBarBackgroundInactive="{DynamicResource VSBackgroundBrush}"/>
                        </docking:SplitContainer>
                    </docking:DockSite>
Thanks

[Modified at 03/29/2011 04:15 PM]
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Billy,

The TitleBarButtons are located in the ControlTemplate of the ToolWindowContainer. You can use implicit Styles to set properties on the buttons. Otherwise, you'd need to retemplate ToolWindowContainer.


Actipro Software Support

Posted 8 years ago by Billy Jacobs
Avatar
Please look at this image to see what I am still missing? I have 3 things described there.

Here are screenshots with my issues.

Can you send and example of how to fix these?

Thanks,

Billy Jacobs

[Modified at 04/05/2011 03:10 PM]

[Modified at 04/05/2011 03:11 PM]

[Modified at 04/05/2011 03:12 PM]
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Billy,

Sorry, but we don't currently have a sample like that, a quick example would be to include this in your application resources:

<Style TargetType="{x:Type docking:TitleBarButton}">
<Setter Property="ForegroundActiveDisabled" Value="Red" />
<Setter Property="ForegroundActiveHover" Value="Red" />
<Setter Property="ForegroundActiveNormal" Value="Red" />
<Setter Property="ForegroundActivePressed" Value="Red" />
<Setter Property="ForegroundInactiveDisabled" Value="Red" />
<Setter Property="ForegroundInactiveHover" Value="Red" />
<Setter Property="ForegroundInactiveNormal" Value="Red" />
</Style>

The area around the tabbed MDI documents can be configured using an implicit Style for the TabbedMdiContainer that sets one or more of the Outline* properties.


Actipro Software Support

Posted 7 years ago by Andreas.Hassmann
Avatar

Hello Actipro,

 

I ran into the same ArgumentException problem while trying to style a ToolWindowContainer.

Steps to reproduce:

 

Create a tree containing a ToolWindowContainer

Rightclick the container -> Edit template -> Edit a copy...

 

The resulting style can not be edited in Blend because of this strange Exception.

Do you see that, too?

 

Regards,

Andreas.

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

Hi Andreas,

Blend doesn't always clone styles and templates correctly, instead you should clone the template directly from our source. Since you are a WPF Studio customer the default styles are available to you in your account.


Actipro Software Support

Posted 7 years ago by Andreas.Hassmann
Avatar

Great. But...Where? Cannot find it on the website...

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

Hi Andreas,

Sorry, we made a bit of a mistake on our end, I had thought you were already a customer. Before you can get the default styles you have to buy the product. If you buy the Studio then the styles will be available on your organization's account page, and if you own only Docking then you can email our support address and we will send you the select styles for docking. I apologize for the confusion.


Actipro Software Support

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