microsoft / xaml-standard

XAML Standard : a set of principles that drive XAML dialect alignment
Other
804 stars 50 forks source link

Proposal Add WrapPanel #166

Open insinfo opened 7 years ago

insinfo commented 7 years ago

The WrapPanel is a WPF Panel similar to a TilePanel that wraps its content by placing the items at the topmost position in the control. This is useful when displaying a collection of different sized objects and the collection order is not important. The Panel also respects the Orientation property for wrapping either horizontally or vertically.

<WrapPanel >
    <WrapPanel.Resources>  
        <Style TargetType="{x:Type Rectangle}">
            <Setter Property="Width"
                    Value="80" />
            <Setter Property="Height"
                    Value="80" />
            <Setter Property="Margin"
                    Value="3" />
            <Setter Property="Fill"
                    Value="#4DB4DD" />
        </Style>
    </WrapPanel.Resources>

    <Rectangle Width="150" />
    <Rectangle />
    <Rectangle />
    <Rectangle />
    <Rectangle Width="200"/>
    <Rectangle />
    <Rectangle />
    <Rectangle />
    <Rectangle  Width="220"/>
    <Rectangle />
    <Rectangle />
</WrapPanel>

wrappanel

wrappanel control wpf tilepanel 2 tilepanel 1