In This Article

TextViewScrollState Struct

Represents a scroll state within an ITextView.

public struct TextViewScrollState

Constructors

TextViewScrollState(TextPosition)

Initializes an instance of the structure using Top and no vertical amount offset.

public TextViewScrollState(TextPosition verticalAnchorTextPosition)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

TextViewScrollState(TextPosition, TextViewVerticalAnchorPlacement, double, double)

Represents a scroll state within an ITextView.

public TextViewScrollState(TextPosition verticalAnchorTextPosition, TextViewVerticalAnchorPlacement verticalAnchorPlacement, double verticalAmountOffset, double horizontalAmount)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

verticalAnchorPlacement TextViewVerticalAnchorPlacement

A TextViewVerticalAnchorPlacement indicating the placement of the anchor view line.

verticalAmountOffset double

The vertical scroll amount to move the anchor view line from its placement, where a positive number means downward and a negative number means upward.

horizontalAmount double

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

TextViewScrollState(TextPosition, double)

Initializes an instance of the structure using Top and no vertical amount offset.

public TextViewScrollState(TextPosition verticalAnchorTextPosition, double horizontalAmount)
Parameter Type Description
verticalAnchorTextPosition TextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

horizontalAmount double

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

Properties

CanScrollPastDocumentEnd

Indicates whether the view can scroll past the document end.

public bool CanScrollPastDocumentEnd { readonly get; set; }

Property Value

bool:

true if the view can scroll past the document end; otherwise, false. The default value is false.

HorizontalAmount

The horizontal scroll amount (in pixels), which is the absolute first visible x-coordinate in the view.

public double HorizontalAmount { readonly get; set; }

Property Value

double:

The default value is 0.

VerticalAmountOffset

The vertical scroll amount to move the anchor view line from its placement, where a positive number means downward and a negative number means upward.

public double VerticalAmountOffset { readonly get; set; }

Property Value

double:

The default value is 0.

VerticalAnchorPlacement

A TextViewVerticalAnchorPlacement indicating the placement of the anchor view line.

public TextViewVerticalAnchorPlacement VerticalAnchorPlacement { readonly get; set; }

Property Value

TextViewVerticalAnchorPlacement:

The default value is Top.

VerticalAnchorTextPosition

A TextPosition indicating a character (typically the first) on the anchor view line, around which other view lines are arranged.

public TextPosition VerticalAnchorTextPosition { readonly get; set; }

Property Value

TextPosition

Methods

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object? obj)
Parameter Type Description
obj object

The object to compare with the current instance.

Returns

bool:

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int:

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(TextViewScrollState, TextViewScrollState)

Compares two TextViewScrollState objects. The result specifies whether the property values of the two TextViewScrollState objects are equal.

public static bool operator ==(TextViewScrollState left, TextViewScrollState right)
Parameter Type Description
left TextViewScrollState

A TextViewScrollState to compare.

right TextViewScrollState

A TextViewScrollState to compare.

Returns

bool:

true if the property values of are equal; otherwise, false.

operator !=(TextViewScrollState, TextViewScrollState)

Compares two TextViewScrollState objects. The result specifies whether the property values of the two TextViewScrollState objects are unequal.

public static bool operator !=(TextViewScrollState left, TextViewScrollState right)
Parameter Type Description
left TextViewScrollState

A TextViewScrollState to compare.

right TextViewScrollState

A TextViewScrollState to compare.

Returns

bool:

true if the property values of are unequal; otherwise, false.

Inherited Members