Here’s a fairly common question that can be solved fairly easily. Sometimes when you have a ListBox of Items you would like for those items to stretch the available width of the ListBox. Sounds pretty straightforward right? Given we have something similar to the below XAML :
You would think that this would get the trick done right? After all I told the Grid in the DataTemplate that the second column needed to have a expansible width that would take up any of the left-over space from the button columns. Unfortunately this won’t work and the items will only be sized to the largest one in the set. So if you want it to stretch the entire width of the ListBox’s ItemPanel you need to use the following attribute in the ListBox itself:
This will cause the contents to take up the entire width of the ListBox.