This panel stretches the children in the orientation direction so that they completely fill the panel area.
This sample will fill the entire area with bars of red, blue, green, and yellow.
<Window x:Class="AutoStretchStackPanelSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="AutoStretchStackPanelSample">
<Grid>
<xctk:AutoStretchStackPanel>
<Rectangle Stretch="Fill"
Fill="Red" />
<Rectangle Stretch="Fill"
Fill="Blue" />
<Rectangle Stretch="Fill"
Fill="Green" />
<Rectangle Stretch="Fill"
Fill="Yellow" />
</xctk:AutoStretchStackPanel>
</Grid>
</Window>
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2