CornerRadius Structure
Represents the radii of a rectangle's corners.
Assembly: PresentationFramework (in PresentationFramework.dll)
| Name | Description | |
|---|---|---|
![]() | CornerRadius(Double) | Initializes a new instance of the CornerRadius class with a specified uniform radius value for every corner or the rectangle. |
![]() | CornerRadius(Double, Double, Double, Double) | Initializes a new instance of the CornerRadius class with the specified radius values for each corner of the rectangle. |
| Name | Description | |
|---|---|---|
![]() | BottomLeft | Gets or sets the radius of the bottom-left corner. |
![]() | BottomRight | Gets or sets the radius of the bottom-right corner. |
![]() | TopLeft | Gets or sets the radius of the top-left corner. |
![]() | TopRight | Gets or sets the radius of the top-right corner. |
| Name | Description | |
|---|---|---|
![]() | Equals(CornerRadius) | Compares two CornerRadius structures for equality. |
![]() | Equals(Object^) | Determines whether the specified Object is a CornerRadius and whether it contains the same corner radius values as this CornerRadius. (Overrides ValueType::Equals(Object^).) |
![]() | GetHashCode() | Returns the hash code for this CornerRadius. (Overrides ValueType::GetHashCode().) |
![]() | GetType() | |
![]() | ToString() | Returns the string representation of the CornerRadius. (Overrides ValueType::ToString().) |
| Name | Description | |
|---|---|---|
![]() ![]() | Equality(CornerRadius, CornerRadius) | Compares two CornerRadius structures for equality. |
![]() ![]() | Inequality(CornerRadius, CornerRadius) | Compares two CornerRadius structures for inequality. |
This class has four properties, TopLeft, TopRight, BottomLeft, and BottomRight, corresponding to the individual corners of the rectangle. Each is a Double structure that can be set independently of the others.
The radii cannot be negative.
<object property="TopLeft,TopRight,BottomRight,BottomLeft "/> - or - <object property="AllCorners"/>
- TopLeft
Double value that specifies the radius of the top left corner.
- TopRight
Double value that specifies the top right corner.
- BottomRight
Double value that specifies the bottom right corner.
- BottomLeft
Double value that specifies the bottom left corner.
- AllCorners
If only a single Double value is specified, that measure is applied to ALL of the TopLeft, TopRight, BottomRight, and BottomLeft corners of the CornerRadius.
Note |
|---|
Values need not include the decimal point explicitly when specified as a string. The string "1" provided in XAML evaluates to a value of 1.0 when referenced in code. |
The following example shows how to set the value of the CornerRadius property by using Extensible Application Markup Language (XAML) and code.
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.




