Specify the max number of columns for a WrapPanel in WPF

前端 未结 4 508
广开言路
广开言路 2021-02-07 03:13

I have a WrapPanel, And I want to specify the Max number of its columns. So, for example, when my Collection \"ObjectCollection\" (binded to this WrapPanel) contains only 4 elem

4条回答
  •  终归单人心
    2021-02-07 03:56

    Sometimes the UniformGrid is not enough:

    • when items are of very different sizes, or
    • when you want items vertically and don't want to use other workarounds

    In this stackoverflow post can be found a WrapPanel with what you are searching for.

    Xaml:

    
        
        
        
        
        
        
        
    
    

    Result:

提交回复
热议问题