I have a ScrollViewer, which contains a DockPanel, which contains a ListBox as its filled element. The problem I'm facing is that, when the ListBox contains many items, and the height of the window is reduced to the point where a scrollbar is necessary, the ScrollViewer's scrollbar appears, pushing my controls with DockPanel.Dock="Bottom" off the screen. The ListBox's scrollbar never appears. Instead, when the window height is reduced, I would like the ListBox's scrollbar to appear first. Then, after the ListBox shrinks to some minimum height that I specify, the ScrollViewer's scrollbar should appear to take care of the rest.
How do?