WPF layout When you find a problem, the listbox in the grid, always can not fill the entire grid, but the view Code also does not set the relevant properties, originally set the listbox before the first to fill the container, The listbox can then fill the entire layout with the following code:
<ListBox.ItemContainerStyle>
<style targettype= "ListBoxItem" >
<setter property= "HorizontalAlignment" value= "Stretch" ></Setter>
<setter property= "horizontalcontentalignment" value= "Stretch" ></Setter>
</Style>
</ListBox.ItemContainerStyle>
This ensures that the listbox is filled with the entire interface, which actually sets the ListBoxItem container, and if the container cannot be filled with the grid, then the item must not be filled, and the final expression is that the ListBox cannot fill the layout container!
Questions about the ListBox not being filled in the grid