VariableSizedWrapGrid and WrapGrid children size measuring

Viewed 7588

Both VariableSizedWrapGrid and WrapGrid have strange measuring - they measure all children based on the first item.

Because of that, the following XAML will clip the third item.

    <VariableSizedWrapGrid Orientation="Horizontal">
        <Rectangle Width="50" Height="100" Margin="5" Fill="Blue" />
        <Rectangle Width="50" Height="50" Margin="5" Fill="Red" />
        <Rectangle Width="50" Height="150" Margin="5" Fill="Green" />
        <Rectangle Width="50" Height="50" Margin="5" Fill="Red" />
        <Rectangle Width="50" Height="100" Margin="5" Fill="Red" />
    </VariableSizedWrapGrid>

Seems like VariableSizedWrapGrid measures the first item and then the rest children are measured with desired size of the first one.

Any workarounds?

4 Answers
Related