Size Struct

Summary

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

Syntax

public readonly struct Size : ValueType

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.
Width double
Gets the width.

Methods

Name Value Summary
Constrain(Size) Size
Constrains the size.
Deflate(Thickness) Size
Deflates the size by a Thickness.
Equals(object) bool
Checks for equality between a size and an object.
GetHashCode() int
Returns a hash code for a Size.
Inflate(Thickness) Size
Inflates the size by a Thickness.
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

Extension Methods

Name Value Summary
ToAvnSize() AvnSize
From Helpers
ToSharpDX() Size2F