Preventing Tab headers from horizontal scrolling

Viewed 288

I'm trying to make a tab system where the user can add and remove tabs. I want the Add button to be positioned to the right of the last tab, news tabs should be added after the last tab item which should push the Add button further to the right. The problem I am having is that I can't seem to disable the header scrolling on TabControl so instead of the tab bar extending, it's width stays the same and gives arrow button scrolls.

Here are images and xaml code to illustrate my question:

enter image description here

enter image description here

<Grid Grid.Column="0" Grid.ColumnSpan="1" Grid.RowSpan="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" MaxWidth="800" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="41*" />
            <RowDefinition Height="278*" />
        </Grid.RowDefinitions>

        <dragablz:TabablzControl x:Name="tabs" HeaderMemberPath="Text" 
ShowDefaultCloseButton="True" Grid.RowSpan="2"
                                 HorizontalAlignment="Left"

                                 ScrollViewer.CanContentScroll="False"

ScrollViewer.IsDeferredScrollingEnabled="False"

ScrollViewer.HorizontalScrollBarVisibility="Hidden"

ScrollViewer.VerticalScrollBarVisibility="Hidden">
            <TabItem Header="HOME TAB">
            </TabItem>
        </dragablz:TabablzControl>

        <ListViewItem x:Name="lviAdd" Grid.Column="1" Grid.Row="0" 
Background="Gray" HorizontalAlignment="Left"
                      PreviewMouseDown="LviAdd_PreviewMouseDown" Width="50">
            <materialDesign:PackIcon Kind="Add" Height="30" Width="30" 
Margin="5, 3, 5, 3" Foreground="White" />
        </ListViewItem>
    </Grid>
0 Answers
Related