Get ListBox to resize with window, but not resize with content
问题 There must be an elegant solution to this problem, but I can't find anything online. I have a grid that has one column and row with width/height *, containing a ListBox. I have my Window SizeToContents set to WidthAndHeight to allow the window to resize to the proper size for each set of UI widgets/fonts. When I add items to the ListBox, it resizes, causing the window to grow. I want the ListBox to resize if I change the size of the window, but if I add content that is longer than the width