Wrap first, then scroll
I've read several posts regarding this topic, but haven't quite figured this out yet. I'd like the black squares in this WrapPanel to wrap first, then show the ScrollBar if it's still necessary. I have a working example where the Vertical ScrollBar only shows when necessary, but not the horizontal one.
<Windowx:Class="WrapTesting.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WrapTesting"Height="300"Width="300"
>
<ScrollViewerVerticalScrollBarVisibility="Disabled"HorizontalScrollBarVisibility="Auto"HorizontalAlignment="Stretch"VerticalAlignment="Stretch">
<WrapPanelHeight="Auto" >
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
<RectangleFill="Black"Margin="10,10,0,0"Width="70"Height="70" />
</WrapPanel>
</ScrollViewer>
</Window>

