ListBox is arranged from top to bottom by default. If you want to see the scaling mode of ACDSee or the content mode of Windows resource manager, you need to change the default panel of ListBox:
Replace the default panel of ListBox with wrappanel, but there is another key point:
If your wrappanel uses the horizontal direction (default), set scrollviewer. horizontalscrollbarvisibility = "disabled"; otherwise, it will continue to extend horizontally. In this case, the itemheight of wrappanel is auto, so that the height of each row is the same.
<ListBox itemssource = "{binding source = {staticresource colorsprops }}" <br/> itemtemplate =" {staticresource colortemplate} "<br/> selectedvaluepath =" color "<br/> grid. row = "0" grid. column = "0" <br/> scrollviewer. horizontalscrollbarvisibility = "disabled"> <br/> <ListBox. itemspanel> <br/> <itemspaneltemplate> <br/> <wrappanel/> <br/> </itemspaneltemplate> <br/> </ListBox. itemspanel> <br/> </ListBox> <br/>
Similarly, if your wrappanel uses the vertical direction, you need to set scrollviewer. verticalscrollbarvisibility = "disabled", otherwise it will always extend vertically. In this case, the itemwidth of wrappanel is auto, so that the width of each column is the same.