Corner Radius in Silverlight

Maybe everyone else already knew this, but I sure didn’t.  I knew CornerRadius can be used on a Border to round corners.  For example, the following code creates a rounded corner rectangle.

<Border  Height="135" HorizontalAlignment="Left" Width="347" CornerRadius="20" Background="#FF1322D1"></Border>

image

But what’s not obvious is that CornerRadius actually accepts a comma-delimited list (like Margin does) and lets you set the radius of each corner.

<Border Height="135"HorizontalAlignment="Left"Width="347"CornerRadius="20,40,0,5"Background="#FF1322D1"></Border>

image

 

I guess the designers of Blend didn’t realize this either, because while Margin has 4 boxes for entering values, CornerRadius is just one field:

image

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