Quantcast
Channel: WPF - wrapping stackpanel
Viewing all articles
Browse latest Browse all 3

WPF - wrapping stackpanel

$
0
0

I have a panel with Width = 1400 and it contains smaller Panels with Width = 700. If the screen is at full width the smaller panels should be displayed in 2's per row otherwise it should wrap and a vertical scrollbar should appear.

With the below code the contents are wrapped but no scrollbar:

<StackPanel Grid.Column="1" Grid.Row="1" Background="#FFEAEEFC"><ScrollViewer x:Name="body" HorizontalScrollBarVisibility="Disabled"><WrapPanel Margin="10" MaxWidth="1400"><Border BorderBrush="Black" BorderThickness="1" Width="700" Height="400"></Border><Border BorderBrush="Black" BorderThickness="1" Width="700" Height="400"></Border><Border BorderBrush="Black" BorderThickness="1" Width="700" Height="400"></Border><Border BorderBrush="Black" BorderThickness="1" Width="700" Height="400"></Border></WrapPanel></ScrollViewer></StackPanel>
What am i doing wrong?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images