Tabs Studio Blog (organizing Visual Studio document tabs)

May 1, 2009

Default and custom styles

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 6:49 pm

I’ve made final (I hope) changes to the styling engine to support seamless transition from default to custom style. Syntax for our usual example to change global tabs’ font family and font size is following now:

Style resources settings

Style resources settings


Custom tabs style based on default style

Custom tabs style based on default style

Let’s see how styles were applied in this example. Without any styles tabs’ font size and font family have default values and unoccupied by tabs space is black:

Tabs without style

Tabs without style

Tabs Studio has default TabPanel style that sets unoccupied by tabs space to grey on default Windows theme:

<Style x:Key="DefaultTabPanelStyle" TargetType="TabPanel">
            <Setter Property="Background" Value="{x:Static SystemColors.ControlBrush}"/>
</Style>

Default tabs style with unoccupied by tabs space

Default tabs style with unoccupied by tabs space


When custom TabPanel style is based on DefaultTabPanelStyle unoccupied by tabs space is grey. It is possible to define custom style from scratch and does not use default settings:

<Style TargetType="TabPanel">
    <Setter Property="Control.FontStyle" Value="Italic"/>
</Style>
Custom tabs style not using default settings

Custom tabs style not using default settings

Notice how unoccupied by tabs space is black again when custom TabPanel style is not based on DefaultTabPanelStyle.

Finally, explanation of what WPF XAML resources for TabPanel content means in WPF terms. It is part of ResourceDictionary after namespaces definitions, default Tabs Studio styles and before ResourceDictionary closing tag.

Blog at WordPress.com.