Xamarin.Forms Guides | Samples

Xamarin.Forms.Size Structure

Struct defining height and width as a pair of doubles.

See Also: Size

Syntax

[System.Diagnostics.DebuggerDisplay("Width={Width}, Height={Height}")]
public struct Size

Remarks

Application developers should be aware of the limits of floating-point representations, specifically the possibility of incorrect comparisons and equality checks for values with small differences. David Goldberg's paper What Every Computer Scientist Should Know About Floating-Point Arithmetic describes the issues excellently.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.Size are listed below.

See Also: ValueType

Public Constructors

Creates a new Size object with width and height.

Public Fields

static readonly
ZeroSize. The Size whose values for height and width are 0.0.

Public Properties

HeightDouble. Magnitude along the vertical axis, in platform-specific units.
[read-only]
IsZeroBoolean. Whether the Size has Size.Height and Size.Width of 0.0.
WidthDouble. Magnitude along the horizontal axis, in platform-defined units.

Public Methods

override
Equals(Object) : Boolean
Whether thisSize is equivalent to obj.
Equals(Size) : Boolean
Whether thisSize is equivalent to other.
override
GetHashCode() : Int32
Returns a hash value for the Size.
override
ToString() : String
Returns a human-readable representation of the Size.

Public Operators

static
Addition(Size, Size)Returns a new Size whose Size.Height and Size.Width are the sum of the component's height and width.
static
Equality(Size, Size)Whether two Sizes have equal values.
static
Inequality(Size, Size)Whether two Sizes have unequal values.
static
Multiply(Size, Double)Scales both Size.Width and Size.Height.
static
Subtraction(Size, Size)Returns a new Size whose Size.Height and Size.Width are s1's height and width minus the values in s2.
static
Conversion to Xamarin.Forms.Point(Explicit)Returns a new Point based on a Size.