Create a square border, with image inside and width and height dependent to uniform grid colum?

Removing the Margin from the border and setting it on the Image, creates a Border around the Image which is exactly as big as a ListviewItem is. See picture.

Removing the Margin from the border and setting it on the Image, creates a Border around the Image which is exactly as big as a ListviewItem is. See picture. If that is not what you expected, please define more clearly.

EDIT: Add VerticalContentAlignment="Stretch" to your ListBox and the images should resize properly. See picture below. EDIT II: If you want the images to appear as squares, you have to set the Border's Height to its current Width: Height="{Binding RelativeSource={RelativeSource Self}, Path=ActualWidth}.

This is the result I'd like, but the images I'm trying to show have different resolutions (the reason for uniform stretch). In this solution you're using standard Windows backgrounds, and they all are 1024*768 images. My images have various sizes.

Some are in a portrait format others in landscape and others are almost squared. I've tried your suggestions but the result do not change. Are you sure that this should work even with images with different aspect ratio?

– Fr. Usai 20 hours ago OK, now I understand your issue. See my edit and try that out.

– SvenG 19 hours ago I suggested the same. :) – BigL 19 hours ago is it the image or are those borders rectangular, I thought the OP wanted them square? – Bob Vale 18 hours ago @Bob You're correct, I didn't set the Border height to be square.

Fixed that similar to your approach – SvenG 18 hours ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions