Size Struct

Summary

Defines a size.
Namespace
Avalonia
Interfaces
Base Types
  • object
  • ValueType
graph BT Type-->Base0["ValueType"] Base0-->Base1["object"] Type-.->Interface0["IEquatable<Size>"] Type["Size"] class Type type-node

Syntax

public readonly struct Size : ValueType, IEquatable<Size>

Constructors

Name Summary
Size(double, double) Initializes a new instance of the Size structure.

Fields

Name Constant Value Summary
Empty
A size representing zero
static
Infinity
A size representing infinity.
static

Properties

Name Value Summary
AspectRatio double
Gets the aspect ratio of the size.
Height double
Gets the height.
IsDefault bool
Gets a value indicating whether the Width and Height values are zero.
Width double
Gets the width.

Methods

Name Value Summary
Constrain(Size) Size
Constrains the size.
Deconstruct(double, double) void
Deconstructs the size into its Width and Height values.
Deflate(Thickness) Size
Deflates the size by a Thickness.
Equals(object) bool
Checks for equality between a size and an object.
Equals(Size) bool
Returns a boolean indicating whether the size is equal to the other given size (bitwise).
GetHashCode() int
Returns a hash code for a Size.
Inflate(Thickness) Size
Inflates the size by a Thickness.
NearlyEquals(Size) bool
Returns a boolean indicating whether the size is equal to the other given size (numerically).
Parse(string) Size
Parses a Size string.
static
ToString() string
Returns the string representation of the size.
WithHeight(double) Size
Returns a new Size with the same width and the specified height.
WithWidth(double) Size
Returns a new Size with the same height and the specified width.

Operators

Name Value Summary
operator !=(Size, Size) bool
operator -(Size, Size) Size
operator *(Size, double) Size
operator *(Size, Vector) Size
operator /(Size, double) Size
operator /(Size, Size) Vector
operator /(Size, Vector) Size
operator +(Size, Size) Size
operator ==(Size, Size) bool