Joris Weimar
Joris Weimar

Reputation: 4931

ImageButton images not resized

I have an ImageButton:

<toolkit:ImageButton Style="{StaticResource transportButtonStyle}" Click="SeekBackwardClick"
                                 NormalStateImageSource="/Assets/Images/rewind.png"
                                 HoverStateImageSource="/Assets/Images/rewind.png"
                                 PressedStateImageSource="/Assets/Images/rewind.png">
</toolkit:ImageButton>

However, when I change the Width or Height parameters, the images are not scalled proportionally. When it concerns an

<Image ...>

tag, it works fine because I can set the Stretch attribute but this is missing from the ImageButton. Easiest way to get this functionality on ImageButton?

Upvotes: 2

Views: 1652

Answers (1)

Filip Skakun
Filip Skakun

Reputation: 31724

Edit the control template to make the Images inside stretch. I think I left them non-stretched so that I could swap image assets without needing to update the sizes of the buttons. I guess I could add some property to the button class bound to the images to enable an easy way to control it. But changing the template should work for you for now.

Upvotes: 1

Related Questions