Metro Nuggets

Bitesized tidbits for building Modern (Metro) apps.

Resizing the RadImageButton

Telerik have a great range of controls that allow you to build some really cool looking interfaces for Windows Phone. One of those controls is the RadImageButton, which lets you set an image and it creates an appbar style button for you. However, I wanted the button to be a different size to the default one, how to go about doing that?

The Solution

I tried a number of things to resize it, setting the MaxHeight/MaxWidth, Height/Width, neither of these things were making a difference. In fact, all they were doing was chopping off parts of the button. In the end, at the suggestion of @lancewmccarthy I ended up just retemplating the control and make it smaller that way. It wasn’t ideal, but at least it worked.

But I then noticed something in the control’s xaml. The size of the button wasn’t being controlled by the aforementioned properties, for some reason, it was being determined by the MinHeight/MinWidth properties, which seemed a little counter-intuitive to me. So I removed the new style and set the MinHeight/MinWidth properties and lo and behold, the control was now at the size I wanted.

SL

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: