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 WrapPanel. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With