[]
        
(Showing Draft Content)

C1.WPF.PopupUtil.TestPosition

TestPosition Method

TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, Point, double, double, FlowDirection)

Calculates the position of a FrameworkElement so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.

Declaration
public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, Point elementOffset, double overlapHorizontal, double overlapVertical, FlowDirection flowDir)
Parameters
Type Name Description
FrameworkElement positionElement

The element to position.

Anchor positionAnchor

An Anchor value specifying the point in the element to position.

FrameworkElement element

The FrameworkElement to use as reference.

Anchor elementAnchor

An Anchor value specifying the point in the FrameworkElement used as reference.

Point elementOffset

The offset (absolute position) of the reference element.

double overlapHorizontal

The horizontal overlap between the elements (used for corner matching's).

double overlapVertical

The vertical overlap between the elements (used for corner matching's).

FlowDirection flowDir

The FlowDirection used for the calculations.

Returns
Type Description
Point

The absolute point where the FrameworkElement would be located.

TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, Point, double, double)

Calculates the position of a FrameworkElement so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.

Declaration
public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, Point elementOffset, double overlapHorizontal, double overlapVertical)
Parameters
Type Name Description
FrameworkElement positionElement

The element to position.

Anchor positionAnchor

An Anchor value specifying the point in the element to position.

FrameworkElement element

The FrameworkElement to use as reference.

Anchor elementAnchor

An Anchor value specifying the point in the FrameworkElement used as reference.

Point elementOffset

The offset (absolute position) of the reference element.

double overlapHorizontal

The horizontal overlap between the elements (used for corner matching's).

double overlapVertical

The vertical overlap between the elements (used for corner matching's).

Returns
Type Description
Point

The absolute point where the FrameworkElement would be located.

TestPosition(Popup, Anchor, FrameworkElement, Anchor, double, double)

Calculates the position of a Popup so that the specified point in the Popup matches the specified point of a FrameworkElement.

Declaration
public static Point TestPosition(Popup popup, Anchor popupAnchor, FrameworkElement element, Anchor elementAnchor, double overlapHorizontal, double overlapVertical)
Parameters
Type Name Description
Popup popup

The popup to position.

Anchor popupAnchor

An Anchor value specifying the point in the Popup.

FrameworkElement element

The FrameworkElement to use as reference.

Anchor elementAnchor

An Anchor value specifying the point in the FrameworkElement.

double overlapHorizontal

The horizontal overlap between the elements (used for corner matching's).

double overlapVertical

The vertical overlap between the elements (used for corner matching's).

Returns
Type Description
Point

The absolute point where the popup would be located

TestPosition(Popup, Anchor, FrameworkElement, Anchor)

Calculates the position of a Popup so that the specified point in the Popup matches the specified point of a FrameworkElement.

Declaration
public static Point TestPosition(Popup popup, Anchor popupAnchor, FrameworkElement element, Anchor elementAnchor)
Parameters
Type Name Description
Popup popup

The popup to position.

Anchor popupAnchor

An Anchor value specifying the point in the Popup.

FrameworkElement element

The FrameworkElement to use as reference.

Anchor elementAnchor

An Anchor value specifying the point in the FrameworkElement.

Returns
Type Description
Point

The absolute point where the popup would be located

TestPosition(FrameworkElement, Anchor, FrameworkElement, Anchor, double, double)

Calculates the position of a FrameworkElement so that the specified point in the FrameworkElement matches the specified point of another FrameworkElement.

Declaration
public static Point TestPosition(FrameworkElement positionElement, Anchor positionAnchor, FrameworkElement element, Anchor elementAnchor, double overlapHorizontal, double overlapVertical)
Parameters
Type Name Description
FrameworkElement positionElement

The element to position.

Anchor positionAnchor

An Anchor value specifying the point in the element to position.

FrameworkElement element

The FrameworkElement to use as reference.

Anchor elementAnchor

An Anchor value specifying the point in the FrameworkElement used as reference.

double overlapHorizontal

The horizontal overlap between the elements (used for corner matching's).

double overlapVertical

The vertical overlap between the elements (used for corner matching's).

Returns
Type Description
Point

The absolute point where the FrameworkElement would be located.