Answered by:

Auto scale images in ListView with no behind code

Question

I have a ListView that contains one or more images that are all the same size. The size of the image is unknown at design time and can change. But all images in the ListView will be the same size regardless. I would like to scale the images depending on
the number of images in the ListView so that they are all visible. So, more images means the images are scaled smaller. Also, sometimes the images are taller then wide or wider then tall.

Is there any way to do this without latching onto the ListViews sizechange event or other behind code? Ideally, I'd like a solution 100% in XAML or with a generic Converter implementation.

All replies

Your post is off-topic in the UI Design for Windows Store apps forum. I'll move it to a more appropriate forum, but since you don't provide enough information to know for sure which forum is most appropriate please let me know if I miss and I can redirect
again.

I don't think you'll be able to do this wholly in Xaml. My first thought would be to create a custom panel.

In the future, please post questions about implementation in the appropriate Building Windows Store apps in... forum. The UI Design forum is about discussion what the app should look like, not how to implement that design.