How to make usercontrol on a WrapPanel fill correctly each line

45 Views Asked by At

I am looking for a way to make the UserControl fill each line without letting a blank zone at the end of the line.

window with blank at the end of the line

That's my WrapPanel:

<ScrollViewer VerticalAlignment="Stretch" Margin="100,315,100,0" VerticalScrollBarVisibility="Auto" >
    <WrapPanel>
        <Border Margin="10,10,0,0" Width="200" Height="200" CornerRadius="15,15,15,15" BorderThickness="1,1,1,1" BorderBrush="#FF0A5952" Background="#7F95D4C3" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" Cursor="Hand" MouseDown="Border_Coran_MouseDown">
            <Grid >
                <Image Source="/tile_quran.png" Margin="5,5,5,15"></Image>
                <Label Content="Coran" HorizontalAlignment="Center" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontFamily="Verdana" FontSize="18" Foreground="#FF524E44"/>
            </Grid>
        </Border>
    </WrapPanel>
</ScrollViewer>

Does anyone know how to do that?

P.S.: The window can be resized so it needs to change every time we resize the window to fit perfectly each line.

0

There are 0 best solutions below