I'm adding controls dynamically to the StackPanel but all of them are aligned vertically and the items overpass the limit of the Height and not all items are displaying.
Is possible to align the controls based on the height and put it in several columns depending the number and height of the items?
<ScrollViewer Grid.Column="2" x:Name="DetailInfoScroll" Margin="25,0,50,0" Style="{StaticResource HorizontalScrollViewerStyle}" >
<StackPanel Grid.Column="2" Margin="25,0,50,35" HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="StkText">
</StackPanel>
</ScrollViewer>
Adding the controls:
foreach (var text in texts)
{
StkText.Children.Add(new TextBlock
{
Text = text,
TextWrapping = TextWrapping.Wrap,
TextAlignment = TextAlignment.Justify,
FontSize = 14,
Margin = new Thickness(0, 0, 0, 25)
});
}