Skip to content

TabView Padding isn't bound in Style as expected #3736

@michael-hawker

Description

@michael-hawker

Describe the bug
I was trying to remove the inherent padding around the TabViewItems:

image

I figured modifying the Padding value of the TabView itself should adjust this behavior... it does not. ☹

This is modified instead by having to modify the TabViewHeaderPadding resource.

Solution
It looks like the intent was to allow it to modify the padding of the control in the style here in TabView:

<Setter Property="Padding" Value="{ThemeResource TabViewHeaderPadding}" />

However, it was used directly again in the TabViewListView style:

<Style TargetType="primitives:TabViewListView">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="Padding" Value="{ThemeResource TabViewHeaderPadding}" />

It should have been instead exposed and template bound to the main TabView control property when the TabViewListView is used here:

<primitives:TabViewListView
Grid.Column="1"
x:Name="TabListView"
CanReorderItems="{TemplateBinding CanReorderTabs}"
CanDragItems="{TemplateBinding CanDragTabs}"
AllowDrop="{TemplateBinding AllowDropTabs}"
ItemsSource="{TemplateBinding TabItemsSource}"
ItemTemplate="{TemplateBinding TabItemTemplate}"
ItemTemplateSelector="{TemplateBinding TabItemTemplateSelector}"/>

This should be an easy resolution to make it easier for devs to customize the style of the control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions