How do you create a vertically scrollable scrollviewer inside a tabControl?

I want to make my TabControl scroll vertically, but I can't do it. The following example acts as if there was no scrolling. I even tried to put the TabControl inside the scrollviewer or put it in a grid and keep the height of the grid, but nothing works.

    <DataTemplate x:Key="tabControlTemplate">

                <TabControl ItemsSource="{Binding guiItems}" DisplayMemberPath="Title" Height="Auto" Template="{StaticResource mainTabControlTemplateEx}">
                    <TabControl.ContentTemplate>
                            <DataTemplate> 
                                <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
                                    <StackPanel Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                          <ItemsControl ItemsSource="{Binding guiItems }" ItemTemplateSelector="{DynamicResource templateSelector}"/>
                                    </StackPanel>
                                </ScrollViewer>
                            </DataTemplate>
                     </TabControl.ContentTemplate>
                </TabControl>

    </DataTemplate>
+3
source share
1 answer

The actual problem is not clear from the question. Can't you see that scrollviewer and contents inside are cropped? Plase confirm if so.

, , , , , MaxHeight Scroll Viewer. DataTemplate Verticall , MaxHeight.

, .

0

All Articles