Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF MahApps.Metro AnimatedSingleRowTabControl FontSize

How do I change the font size of the tabs when using the MahApps.Metro AnimatedSingleRowTabControl.

When using a normal TabControl, my theme TabItem (based on MetroTabItem) overrides the fontsize but this does not work for the animated single row tab control. I tried setting the fontsize property on the control in the XAML and this didn't work either.

Regards Alan

like image 357
Alan Rutter Avatar asked Oct 04 '13 03:10

Alan Rutter


2 Answers

You can also define the following in the Application.Resources your App.xaml:

<system:Double x:Key="TabItemFontSize">16</system:Double>

Controls.TabControl.xaml makes use of it as follows:

<Setter Property="Controls:ControlsHelper.HeaderFontSize"
        Value="{DynamicResource TabItemFontSize}" />
like image 58
KornMuffin Avatar answered Nov 09 '22 00:11

KornMuffin


You can do the following, setting the header font size to whatever value you want:

<metro:MetroAnimatedSingleRowTabControl>
    <metro:MetroAnimatedSingleRowTabControl.ItemContainerStyle>
        <Style TargetType="{x:Type metro:MetroTabItem}" BasedOn="{StaticResource {x:Type metro:MetroTabItem}}">
            <Setter Property="HeaderFontSize" Value="24"/>
        </Style>
    </metro:MetroAnimatedSingleRowTabControl.ItemContainerStyle>
</metro:MetroAnimatedSingleRowTabControl>
like image 43
Nick Avatar answered Nov 08 '22 22:11

Nick