<ResourceDictionary
    x:ClassModifier="internal"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ControlTheme TargetType="TabControl" x:Key="{x:Type TabControl}">
        <Setter Property="Padding" Value="8" />
        <Setter Property="Template">
            <ControlTemplate>
                <Border
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    CornerRadius="{TemplateBinding CornerRadius}"
                    HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                    Padding="{TemplateBinding Padding}"
                    VerticalAlignment="{TemplateBinding VerticalAlignment}">
                    <DockPanel>
                        <ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}" Name="PART_ItemsPresenter" />
                        <ContentPresenter
                            Content="{TemplateBinding SelectedContent}"
                            ContentTemplate="{TemplateBinding SelectedContentTemplate}"
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Margin="{TemplateBinding Padding}"
                            Name="PART_SelectedContentHost"
                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </DockPanel>
                </Border>
            </ControlTemplate>
        </Setter>
        <Style Selector="^[TabStripPlacement=Top]">
            <Setter Property="Padding" Value="0 4 0 0" />
        </Style>
        <Style Selector="^[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter">
            <Setter Property="DockPanel.Dock" Value="Top" />
        </Style>
        <Style Selector="^[TabStripPlacement=Bottom] /template/ ItemsPresenter#PART_ItemsPresenter">
            <Setter Property="DockPanel.Dock" Value="Bottom" />
        </Style>
        <Style Selector="^[TabStripPlacement=Bottom]">
            <Setter Property="Padding" Value="0 0 0 4" />
        </Style>
        <Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter">
            <Setter Property="DockPanel.Dock" Value="Left" />
        </Style>
        <Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter &gt; WrapPanel">
            <Setter Property="Orientation" Value="Vertical" />
        </Style>
        <Style Selector="^[TabStripPlacement=Left]">
            <Setter Property="Padding" Value="4 0 0 0" />
        </Style>
        <Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter">
            <Setter Property="DockPanel.Dock" Value="Right" />
        </Style>
        <Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter &gt; WrapPanel">
            <Setter Property="Orientation" Value="Vertical" />
        </Style>
        <Style Selector="^[TabStripPlacement=Right]">
            <Setter Property="Padding" Value="0 0 4 0" />
        </Style>
    </ControlTheme>
</ResourceDictionary>