How do I make an ItemsControl stretch to fill all availible space?

后端 未结 4 361
青春惊慌失措
青春惊慌失措 2021-01-19 17:02

I have an ItemsControl, with its ItemsSource bound to a list of items. The size of each of the items is as small as they can be, what I need is for the control and the items

4条回答
  •  无人及你
    2021-01-19 17:28

    I had the same problem and found out that ItemsControl by default uses a StackPanel for his children. Replacing this with a Grid solved the problem:

     
          
               
                    
               
          
     
    

    Edit: This only works for one child element!

提交回复
热议问题