Changing shape of tabs

Docking/MDI for WPF Forum

Posted 13 years ago by Bradley
Avatar
I've been looking through the styles and have been able to change almost everything I've wanted to. However, I'd like to change the way the actual tabs themselves look so that instead of being slanted and then rounded they'd just be a regular rectangle, similar to the picture I've attached. Thanks.



http://i.imgur.com/mp06e.png

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bradley,

The DocumentWindow/ToolWindows are responsible for rendering their associated tab, so you'd need to customize their ControlTemplate. Assuming you are using the latest version, you can look in Common.xaml for the DockingWindowStyleBase Style. It has a Trigger which applies the document style tab.

The DocumentTabDecorator is what renders the slanted border, so you'd probably just replace that with a Border.


Actipro Software Support

Posted 13 years ago by Bradley
Avatar
I had actually tried that, but it didn't work then or now. For some reason no matter what i change inside of the DockingWindowStyleBase trigger for the style, nothing gets changed in my app. I even tried removing everything in the style trigger and that didn't have any affect either. I know I'm referencing the Common.xaml file correctly because I changed this line

                    <dockingPrimitives:DockingWindowTabPanel HorizontalAlignment="Left"
                                                             SelectedTab="{Binding RelativeSource={RelativeSource AncestorType={x:Type docking:TabbedMdiContainer}}, Path=SelectedItem}"
                                                             HorizontalTabSpacing="2">
                    </dockingPrimitives:DockingWindowTabPanel>
else where in the same file, to make the tabs move apart and not cover each other up, and it worked fine. I'm using build 0541 instead of 0542, but the release notes don't mention anything about the DocumentTabDecorator so I don't think the minor version difference is the cause.

[Modified at 03/17/2011 04:20 PM]
Posted 13 years ago by Bradley
Avatar
Finally got it working. The problem was that I was using custom DocumentWindows. Apparently children don't take their parents styles, so for each custom DocumentWindow I have I needed to add
   <Style x:Key="{x:Type custom:WorkSpaceWindow}"
           TargetType="{x:Type custom:WorkSpaceWindow}"
           BasedOn="{StaticResource DockingWindowStyleBase}" />
where custom:WorkSpaceWindow is the name of the child class.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bradley,

Glad you got it working and that is correct. By default, implicit Styles for a base class are not applied to any derived classes.


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.