RelativeRect Struct
Definition
Defines a rectangle that may be defined relative to a containing element.
public struct RelativeRect
Constructors
| Name | Description |
|---|---|
| RelativeRect (5 overloads) | Initializes a new instance of the Avalonia.RelativeRect structure. |
RelativeRect overloads
RelativeRect Constructor
Initializes a new instance of the Avalonia.RelativeRect structure.
public RelativeRect(Avalonia.Point topLeft, Avalonia.Point bottomRight, Avalonia.RelativeUnit unit)
Parameters
topLeft Avalonia.Point
The top left position of the rectangle.
bottomRight Avalonia.Point
The bottom right position of the rectangle.
The unit of the rect.
RelativeRect Constructor
Initializes a new instance of the Avalonia.RelativeRect structure.
public RelativeRect(Avalonia.Point position, Avalonia.Size size, Avalonia.RelativeUnit unit)
Parameters
position Avalonia.Point
The position of the rectangle.
size Avalonia.Size
The size of the rectangle.
The unit of the rect.
RelativeRect Constructor
Initializes a new instance of the Avalonia.RelativeRect structure.
public RelativeRect(Avalonia.Rect rect, Avalonia.RelativeUnit unit)
Parameters
rect Avalonia.Rect
The rectangle.
The unit of the rect.
RelativeRect Constructor
Initializes a new instance of the Avalonia.RelativeRect structure.
public RelativeRect(Avalonia.Size size, Avalonia.RelativeUnit unit)
Parameters
size Avalonia.Size
The size of the rectangle.
The unit of the rect.
RelativeRect Constructor
Initializes a new instance of the Avalonia.RelativeRect structure.
public RelativeRect(double x, double y, double width, double height, Avalonia.RelativeUnit unit)
Parameters
x double
The X position.
y double
The Y position.
width double
The width.
height double
The height.
The unit of the rect.
Methods
| Name | Description |
|---|---|
| Equals (2 overloads) | Checks if the Avalonia.RelativeRect equals another rectangle. |
| GetHashCode | Gets a hashcode for a Avalonia.RelativeRect. |
| Parse | Parses a Avalonia.RelativeRect string. |
| ToPixels (2 overloads) | Converts a Avalonia.RelativeRect into pixels. |
Equals overloads
Equals Method
Checks if the Avalonia.RelativeRect equals another rectangle.
public bool Equals(Avalonia.RelativeRect p)
Parameters
The other rectangle.
Returns
bool
True if the objects are equal, otherwise false.
Equals Method
Checks if the Avalonia.RelativeRect equals another object.
public bool Equals(object obj)
Parameters
obj object
The other object.
Returns
bool
True if the objects are equal, otherwise false.
GetHashCode Method
Gets a hashcode for a Avalonia.RelativeRect.
public int GetHashCode()
Returns
int
A hash code.
Parse Method
Parses a Avalonia.RelativeRect string.
public Avalonia.RelativeRect Parse(string s)
Parameters
s string
The string.
Returns
The parsed Avalonia.RelativeRect.
ToPixels overloads
ToPixels Method
Converts a Avalonia.RelativeRect into pixels.
public Avalonia.Rect ToPixels(Avalonia.Rect boundingBox)
Parameters
boundingBox Avalonia.Rect
The bounding box of the visual.
Returns
The origin point in pixels.
ToPixels Method
Converts a Avalonia.RelativeRect into pixels.
public Avalonia.Rect ToPixels(Avalonia.Size size)
Parameters
size Avalonia.Size
The size of the visual.
Returns
The origin point in pixels.
Properties
Rect Property
Gets the rectangle.
public Avalonia.Rect Rect { get; set; }
Unit Property
Gets the unit of the rectangle.
public Avalonia.RelativeUnit Unit { get; set; }
Fields
| Name | Description |
|---|---|
| Fill | A rectangle that represents 100% of an area. |
Fill Field
A rectangle that represents 100% of an area.
public Avalonia.RelativeRect Fill