The problem is that StackPanels try to take up as little space as possible.
Just remove them and you should be fine.
<GroupBox>
<ListBox />
</GroupBox>
If that doesn t fit your situation, we ll need a bit more context on where the ListBox is going.
DockPanels are also good for making controls use up the remaining space. The last item inside a DockPanel uses all the remaining space (as long as you haven t set LastChildFill = false).
The below example allows the TextBlock to take up as much space as it needs at the top, and then the GroupBox with the ListView takes up the rest.
<DockPanel>
<TextBlock DockPanel.Dock="Top" Text="My TextBlock Text" />
<GroupBox>
<ListBox />
</GroupBox>
</DockPanel>