Stretch empty WPF ListView to take the remaining space

后端 未结 2 1208
渐次进展
渐次进展 2021-02-06 22:23

I always have problems with a ListView inside a dynamic layout control like a Stackpanel.

Right now I have a Window with a Stackpanel as Root-Control. The Stackpanel str

2条回答
  •  暖寄归人
    2021-02-06 22:57

    How about using a grid? Grids are made for this kind of layout. The DockPanel is a good suggestion too.

        
        
          
          
          
         
    
       
       

    The important part is the Height="*", this tells the row to take up all available space, you can leave this out if you want as it is the default behaviour.

提交回复
热议问题