0

I'm trying to apply a vertical scrollbar to the Dragablz TabControl. Minimum example:

MainWindow.cs

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            TabablzControl tb = new TabablzControl();

            TabItem tabItem;

            for (int i = 0; i < 15; i++)
            {
                tabItem = new TabItem
                {
                    Header = $"Tab_{i}"

                };

                tb.Items.Add(tabItem);
            }
            tb.TabStripPlacement = Dock.Left;

            MystackPanel.Children.Add(tb);
        }
    }

MainWindow.xaml:

<Window x:Class="WpfApp3.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:local="clr-namespace:WpfApp3"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <ScrollViewer>
        <StackPanel x:Name="MystackPanel">

        </StackPanel>
    </ScrollViewer>

</Window>

Currently the vertical scrollbar appears only when the stackpanel that holds the TabablzControl is wrapped with the scrollviewer. However, it's still not possible to scroll within the tabs. I tried also this solution https://stackoverflow.com/a/36919193/9200834 to build a custom control template. This fails, because this Dragablz style is not applicable to the TabItem object.

Does anyone have an idea, how to put a vertical scrollbar to the Dragablz tabs?

PythonNoob
  • 914
  • 1
  • 7
  • 15
  • Try to remove the `StackPanel`: https://stackoverflow.com/questions/45802078/xaml-wpf-scrollviewer-which-has-stackpanel-inside-is-not-scrolling/45820825#45820825 – mm8 Jun 10 '19 at 09:57
  • This doesn't solve the problem. – PythonNoob Jun 10 '19 at 16:31

0 Answers0