Sunday, July 24, 2011

Image control stretch "UniformToFill" not works

     I got a situation when I set Image control's stretch to "UniformToFill", it seems to be "UniformToFill", but exactly left aligned. Finally, I found a solution, but it still confuses me.
Here is the solution:
<grid Height="limitHight" Width="limitWidth">
     <Image Horizontalalignment="Center" 
            Verticalalignment="Center" 
            Stretch="UniformToFill"/>
</grid>

     You just need to change Height and Width properties of the container. It works fine.
Maybe there is a better solution. But I still don't know.

No comments:

Post a Comment