WPF - How can I center all items in a WrapPanel?
问题 I'm using a WrapPanel as the ItemsPanel of an ItemsControl . Right now, the items in the control wrap like this: |1234567 | |890 | I'd like them to wrap like this: | 1234567 | | 890 | Conceptually, the layout process should align each line of items such that it's centered within the WrapPanel 's bounds. Can someone explain how this is possible please? 回答1: The built in WrapPanel will not allow you to align its content - only itself. Here is a technique that allows you to set