I have a view that should display information and to test it I added testdata. However if I add too much items for screen space the vertical scroll bar does not appear.
This is my XML Code:
<UserControl x:Class="not relevant"
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:local="not relevant"
mc:Ignorable="d"
Width="250">
<Border Background="{DynamicResource BG}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<StackPanel>
<Grid>
<Label Height="30" Content="Geöffnete Designs" HorizontalContentAlignment="Center"></Label>
<Separator Background="DarkGray"/>
<ListBox Background="{DynamicResource BG}" BorderThickness="0" VerticalAlignment="Stretch" >
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
<ListBoxItem>
<Label Content="Hallo"></Label>
</ListBoxItem>
</ListBox>
</Grid>
</StackPanel>
</Border>
I tried adding a Scroll viewer instead but that didn't work properly. Am I doing something wrong or what might me the problem?