Struct Size
Describes the width and height of an object.
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public struct Size
Constructors
| Improve this Doc View SourceSize(Double, Double)
Initializes a new instance of the Windows.Foundation.Size structure and assigns it an initial width and height.
Declaration
public Size(double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | width | The initial width of the instance of Windows.Foundation.Size. |
System.Double | height | The initial height of the instance of Windows.Foundation.Size. |
Properties
| Improve this Doc View SourceEmpty
Gets a value that represents a static empty Windows.Foundation.Size.
Declaration
public static readonly Size Empty { get; }
Property Value
Type | Description |
---|---|
Size |
Height
Gets or sets the height of this instance of Windows.Foundation.Size in pixels. The default is 0. The value cannot be negative.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
IsEmpty
Gets a value that indicates whether this instance of Windows.Foundation.Size is Windows.Foundation.Size.Empty.
Declaration
public readonly bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Width
Gets or sets the width of this instance of Windows.Foundation.Size.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceEquals(Object)
Compares an object to an instance of Windows.Foundation.Size for equality.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | The System.Object to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the sizes are equal; otherwise, false. |
Overrides
Equals(Size)
Compares a value to an instance of Windows.Foundation.Size for equality.
Declaration
public bool Equals(Size value)
Parameters
Type | Name | Description |
---|---|---|
Size | value | The size to compare to this current instance of Windows.Foundation.Size. |
Returns
Type | Description |
---|---|
System.Boolean | true if the instances of Windows.Foundation.Size are equal; otherwise, false. |
Equals(Size, Size)
Declaration
public static bool Equals(Size size1, Size size2)
Parameters
Type | Name | Description |
---|---|---|
Size | size1 | |
Size | size2 |
Returns
Type | Description |
---|---|
System.Boolean |
GetHashCode()
Gets the hash code for this instance of Windows.Foundation.Size.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code for this instance of Windows.Foundation.Size. |
Overrides
Parse(String)
Declaration
public static Size Parse(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source |
Returns
Type | Description |
---|---|
Size |
ToString()
Returns a string representation of this Windows.Foundation.Size.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of this Windows.Foundation.Size. |
Overrides
Operators
| Improve this Doc View SourceEquality(Size, Size)
Compares two instances of Windows.Foundation.Size for equality.
Declaration
public static bool operator ==(Size size1, Size size2)
Parameters
Type | Name | Description |
---|---|---|
Size | size1 | The first instance of Windows.Foundation.Size to compare. |
Size | size2 | The second instance of Windows.Foundation.Size to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the two instances of Windows.Foundation.Size are equal; otherwise false. |
Inequality(Size, Size)
Compares two instances of Windows.Foundation.Size for inequality.
Declaration
public static bool operator !=(Size size1, Size size2)
Parameters
Type | Name | Description |
---|---|---|
Size | size1 | The first instance of Windows.Foundation.Size to compare. |
Size | size2 | The second instance of Windows.Foundation.Size to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if the instances of Windows.Foundation.Size are not equal; otherwise false. |