Skip to main content

RelativePoint Struct

Definition​

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Defines a point that may be defined relative to a containing element.

public struct RelativePoint

Inheritance: ValueType -> RelativePoint

Implements: IEquatable<RelativePoint>

Constructors​

NameDescription
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.

unit Avalonia.RelativeUnit

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

unit Avalonia.RelativeUnit

The unit.

Methods​

NameDescription
Equals (2 overloads)Checks if the Avalonia.RelativePoint equals another point.
GetHashCodeGets a hashcode for a Avalonia.RelativePoint.
ParseParses a Avalonia.RelativePoint string.
ToPixels (2 overloads)Converts a Avalonia.RelativePoint into pixels.
ToStringReturns 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​

p Avalonia.RelativePoint

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​

Avalonia.RelativePoint

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​

Avalonia.Point

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​

Avalonia.Point

The origin point in pixels.

ToString Method​

Returns a String representing this RelativePoint instance.

public string ToString()

Returns​

string

The string representation.

Properties​

NameDescription
PointGets the point.
UnitGets the unit.

Point Property​

Gets the point.

public Avalonia.Point Point { get; set; }

Unit Property​

Gets the unit.

public Avalonia.RelativeUnit Unit { get; set; }

Fields​

NameDescription
BottomRightA point at the bottom right of the containing element.
CenterA point at the center of the containing element.
TopLeftA 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