Is it any way to fill available width / height with image in xaml? I need something like UniformToFill, but where I can control stretch direction (width or height)
Assume I have have following code:
<UniformGrid Columns="2" Rows="2"> <Image Source="Desert1.jpg" Stretch="Uniform"/> // <Image Source="Desert2.jpg" Stretch="UniformToFill"/> // <Image Source="Desert3.jpg" /> <Image Source="Desert4.jpg" /> </UniformGrid> EDIT: for examle (width): if image is half as wide as I want to show, I don't care about height and just scale x2 image height and width. So image must fit width, and don't care about height. It's desired behaviour, but if it's not possible - ok. So you can rethink question as IF it possible, HOW can I do it in xaml.
Also all images may have different width and height
Propertyto determine if the image should be stretched on theWidthor on theHeight(of course the other (non-stretched) will be uniformed so that the image'sWidth/Heightis the same to the original image's).