RelativePoint Struct
Definition
Defines a point that may be defined relative to a containing element.
public struct RelativePoint
Constructors
| Name | Description |
|---|---|
| RelativePoint (2 overloads) | Initializes a new instance of the Avalonia.RelativePoint struct. |
RelativePoint overloads
RelativePoint Constructor
Initializes a new instance of the Avalonia.RelativePoint struct.
public RelativePoint(Avalonia.Point point, Avalonia.RelativeUnit unit)
Parameters
point Avalonia.Point
The point.
The unit.
RelativePoint Constructor
Initializes a new instance of the Avalonia.RelativePoint struct.
public RelativePoint(double x, double y, Avalonia.RelativeUnit unit)
Parameters
x double
The X point.
y double
The Y point
The unit.
Methods
| Name | Description |
|---|---|
| Equals (2 overloads) | Checks if the Avalonia.RelativePoint equals another point. |
| GetHashCode | Gets a hashcode for a Avalonia.RelativePoint. |
| Parse | Parses a Avalonia.RelativePoint string. |
| ToPixels (2 overloads) | Converts a Avalonia.RelativePoint into pixels. |
| ToString | Returns a String representing this RelativePoint instance. |
Equals overloads
Equals Method
Checks if the Avalonia.RelativePoint equals another point.
public bool Equals(Avalonia.RelativePoint p)
Parameters
The other point.
Returns
bool
True if the objects are equal, otherwise false.
Equals Method
Checks if the Avalonia.RelativePoint 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.RelativePoint.
public int GetHashCode()
Returns
int
A hash code.
Parse Method
Parses a Avalonia.RelativePoint string.
public Avalonia.RelativePoint Parse(string s)
Parameters
s string
The string.
Returns
The parsed Avalonia.RelativePoint.
ToPixels overloads
ToPixels Method
Converts a Avalonia.RelativePoint into pixels.
public Avalonia.Point ToPixels(Avalonia.Rect rect)
Parameters
rect Avalonia.Rect
The bounding box of the rendering primitive.
Returns
The origin point in pixels.
ToPixels Method
Converts a Avalonia.RelativePoint into pixels.
public Avalonia.Point ToPixels(Avalonia.Size size)
Parameters
size Avalonia.Size
The size of the visual.
Returns
The origin point in pixels.
ToString Method
Returns a String representing this RelativePoint instance.
public string ToString()
Returns
string
The string representation.
Properties
Point Property
Gets the point.
public Avalonia.Point Point { get; set; }
Unit Property
Gets the unit.
public Avalonia.RelativeUnit Unit { get; set; }
Fields
| Name | Description |
|---|---|
| BottomRight | A point at the bottom right of the containing element. |
| Center | A point at the center of the containing element. |
| TopLeft | A point at the top left of the containing element. |
BottomRight Field
A point at the bottom right of the containing element.
public Avalonia.RelativePoint BottomRight
Center Field
A point at the center of the containing element.
public Avalonia.RelativePoint Center
TopLeft Field
A point at the top left of the containing element.
public Avalonia.RelativePoint TopLeft