Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - Why Listbox items do not fill uniformgrid

I have a listbox with the ItemsPanelTemplate set to UniformGrid with rows= 6 and cols= 7.

I want the listbox items to fill their space.

I am using a datatemplete defined in a dictionary.

The outer control of my template is a Border with HorizontalAlignment=Stretch and VerticalAlignent=Strectch but the templates do not fill the listbox items space?

Any ideas? Malcolm

like image 914
Malcolm Avatar asked Dec 10 '22 22:12

Malcolm


1 Answers

The answer to this to set HorizontalContentAligment and VerticalContentAlignment to Stretch on the LISTBOX not the datatemplate.

like image 155
Malcolm Avatar answered Dec 29 '22 19:12

Malcolm