Change how items are displayed WPF list box
问题 I have a WPF window which displays a ListBox . I've changed the ListBox 's item template so that the list box displays rectangular items which can be selected. Now I'd like to modify the ListBox 's ItemsPanelTemplate so that the items are displayed in a grid instead of either a vertical or horizontal list. Specifically I'd like the first item to go in the top right corner of the ListBox and then second item below it and third under that until the height of the next item would make the column