'DockPanel Dock Top element to be scrollable while Dock Bottom does not get hidden

Issue: Creating a DockPanel with Top with flexible height scroller and bottom element.

<DockPanel>
<Scrollview DockPanel.Dock="Top" height="150">
   <Label/>
   <TextBlocx/>
   <Label/>
   <TextBlocx/>
   <Label/>
   <TextBlocx/>
</Scrollview>
<Grid DockPanel.Dock="Bottom">
</Grid>

The issue is with scrollView. When a lot content is added in textboxes and If scrollview height is not set it makes the Bottom Dock Grid disappear. I want to make it a flexible height so that the scroll view adjusts its height according to resized window while making the bottom grid docked to the bottom if the window is resized.(do not want to static height to scroll view). Any help will be appreciated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source