Describes the width and height of an object.
Assembly: System.Windows (in System.Windows.dll)
In the XAML syntax, the width-height delimiter can be either a space or comma. A value uses an internal type converter to process the string value.
See Remarks for additional information on value constraints that apply both to XAML and to code.
Thetype exposes the following members.
|Equals(Object)||Compares an object to an instance of for equality. (Overrides ValueType.Equals(Object).)|
|Equals(Size)||Compares a value to an instance of for equality.|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Gets the hash code for this instance of . (Overrides ValueType.GetHashCode().)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string representation of this . (Overrides ValueType.ToString().)|
Dimensions of 0 are permitted by the structure, but might not be permitted when interpreted or validated by particular properties that take a . Check documentation for the specific property you are setting for possible details on property constraints. In general, the values of a can be greater than or equal to 0.
The programmatic upper limit for values is not PositiveInfinity, it is a lower number (approximately 1,000,000) that is enforced by the Silverlight native code.
Rect is a similar structure that uses the same metaphor of specifying a height and width. However, a Rect specifies an origin point, whereas a does not. In general, Rect is used for APIs that relate to graphical presentation at a lower level, and is used for APIs that relate to UI presentation and layout.
In contrast to other structures such as Thickness, the XAML attribute syntax for does not support a symmetric mode that takes only one value applied to both width and height. For instance the following will generate a parser error: <ArcSegment Size="50"/>.
Negative values for height or width of a are not permitted.
Properties of do not support an attribute syntax in XAML for Silverlight. In XAML you should always specify -type properties through one of the following usages:
The XAML attribute usage, which infers properties that use the type and uses a type converter to process the attribute string into the specific values for the .
A property element usage, containing a object element. For that object element, set the properties using initialization text, as shown in the XAML Object Element Usage.
If you specify a for use as a resource, use the object element usage and set the properties using initialization text.
is available as a valid object in the managed API for Silverlight.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.