Udostępnij za pośrednictwem


AbstractPoint Struct

Definition

A class that represents a point abstractly. This is useful with controls or panels that support multiple orientations. The rendering or layout code for the control or panel can be written using a single, "natural" orientation and then the point can be converted, if necessary, to the control's or panel's actual orientation as needed. This can substantially simplify rendering or layout logic.

public value class AbstractPoint
struct AbstractPoint
public struct AbstractPoint
type AbstractPoint = struct
Public Structure AbstractPoint
Inheritance
AbstractPoint

Constructors

AbstractPoint(Orientation, Orientation, Double, Double)

Initializes a new instance of AbstractPoint.

AbstractPoint(Orientation, Orientation, Point)

Initializes a new instance of AbstractPoint.

AbstractPoint(Orientation, Orientation)

Initializes a new instance of AbstractPoint.

Properties

AbstractX

The abstract X of the point.

AbstractY

The abstract Y of the point.

ActualOrientation

The actual orientation of the geometric unit. This is typically determined by the value of the Orientation property of the control or panel in which this structure is used.

IsNatural

Indiates whether the size's actual orientation matches its natural orientation.

NaturalOrientation

The "natural" orientation of the geometric unit, from the perspective of the context in which it is used. For example, it may be most natural to write the layout code for a StackPanel using Vertical orientation since a stack in the real world is a vertical thing.

The choice of natural orientation within a given context is not important, as long as the same natural orientation is used consistently throughout that context.

RealPoint

The real, non-abstract point represented by this structure. If IsNatural is true, the real point and the abstract point are the same. If IsNatural is false, the real point is the inverse of the abstract point.

RealX

The real, non-abstract X of the point. If IsNatural is true, the real X and the abstract X are the same. If IsNatural is false, the real X is the abstract Y.

RealY

The real, non-abstract Y of the point. If IsNatural is true, the real Y and the abstract Y are the same. If IsNatural is false, the real Y is the abstract X.

Methods

Invert(Point)

Returns a Point structure with the input's X and Y properties swapped.

ToString()

Creates a string representation of this abstract point

Applies to