Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CornerRadius Structure

Describes the characteristics of a rounded corner, such as can be applied to a Border.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public struct CornerRadius
<CornerRadius ...>topLeft,topRight,bottomRight,bottomLeft</CornerRadius>
<object property="uniformRadius"/>
- or -
<object property="topLeft,topRight,bottomRight,bottomLeft"/>

XAML Values

uniformRadius

A value that specifies a uniform radius. The uniformRadius value is applied to all four CornerRadius properties (BottomLeft, TopLeft, TopRight, BottomRight).

topLeft

Sets the initial TopLeft.

topRight

Sets the initial TopRight.

bottomRight

Sets the initial BottomRight.

bottomLeft

Sets the initial BottomLeft.

  • If you specify an attribute string or initialization text with two or three values, only the first value is respected and is treated as the uniformRadius (the other values are ignored). You must specify all four values to use a different behavior than uniformRadius.

  • You can use a space rather than a comma as the delimiter between values.

The CornerRadius type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneCornerRadius(Double)Initializes a new CornerRadius structure, applying the same uniform radius to all its corners.
Public methodSupported by Silverlight for Windows PhoneCornerRadius(Double, Double, Double, Double)Initializes a new instance of the CornerRadius structure, applying specific radius values to its corners.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneBottomLeftGets or sets the radius of rounding, in pixels, of the bottom left corner of the object where a CornerRadius is applied.
Public propertySupported by Silverlight for Windows PhoneBottomRightGets or sets the radius of rounding, in pixels, of the bottom right corner of the object where a CornerRadius is applied.
Public propertySupported by Silverlight for Windows PhoneTopLeftGets or sets the radius of rounding, in pixels, of the top left corner of the object where a CornerRadius is applied.
Public propertySupported by Silverlight for Windows PhoneTopRightGets or sets the radius of rounding, in pixels, of the top right corner of the object where a CornerRadius is applied.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEquals(CornerRadius)Compares this CornerRadius structure to another CornerRadius structure for equality.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Compares this CornerRadius structure to another object for equality. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeReturns the hash code of the structure. (Overrides ValueType.GetHashCode().)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns the string representation of the CornerRadius structure. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberSupported by Silverlight for Windows PhoneEqualityCompares the value of two CornerRadius structures for equality.
Public operatorStatic memberSupported by Silverlight for Windows PhoneInequalityCompares two CornerRadius structures for inequality.
Top

Properties of CornerRadius do not support an attribute syntax in XAML for Silverlight. In XAML you should always specify CornerRadius-type properties through one of the following usages:

  • The XAML attribute usage, which infers properties that use the CornerRadius type and uses a type converter to process the attribute string into the specific values for the CornerRadius.

  • A property element usage, containing a CornerRadius object element. For that object element, set the CornerRadius properties using initialization text, as shown in the XAML Object Element Usage.

If you specify a CornerRadius for use as a resource, use the object element usage and set the CornerRadius properties using initialization text.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

Show:
© 2014 Microsoft