Share free space in a WrapPanel
I'm using a WrapPanel in WPF to display images. When resizing the form, these images are trying to take the maximum of the free spaces but when the picture can almost fill the space, there is a relatively big gap at the end of the WrapPane开发者_如何转开发l. What I would like to do is to share this space between the images before a new one fills this gap (like what Windows 7 Explorer is doing when displaying image icons).
Lookout code of BalancedWrapPanel
for WPF in this article.
Or you may calculate Margin for Images how ((Width of WrapPanel) - (summ Width of Images)) / (Images count)
and set this Margin property for Image type in WrapPanel Resources.
精彩评论