itemspaneltemplate

Having trouble getting contents of ListBox to resize with it

I tried the suggestion here regarding Stretching, but it didn't work for me. I have a TabItem that hosts a UserControl that is essentially just a ListBox with an ItemsPanel. The ItemsPanel forces the ListBox to display its contents horizontally. The contents of the ListBox are databound to an ObservableCollection<StackPanelContents>, ...

Add controls to empty cells in a Grid that's the ItemsPanelTemplate for a ListView

I have a WPF ListView, which has a Grid as an ItemsPanelTemplate. I display my items in the correct column and row based on a property of the item. But I would like to put some controls in the empty cells of my grid. This is a simplified version of my code and xaml: In the resources: <ItemsPanelTemplate x:Key="TheTemplate"> <Grid>...