Xui.Core.UI.Input

Assembly: Xui.Core · C# declarations · Assembly overview

Types

enum EventPhase

Defines the phase of event delivery through the view hierarchy.

public enum EventPhase
{
    Tunnel,
    Bubble
}

EventPhase.Bubble

Bubble

Event is bubbling from the target view up toward the root.

EventPhase.Tunnel

Tunnel

Event is tunneling from the root down toward the target view.

class EventRouter

Routes pointer, mouse, scroll, and touch events through the view tree, performing hit testing, pointer capture, and enter/leave tracking.

public class EventRouter
{
    public EventRouter(View rootView);
    public void Dispatch(ref TouchEventRef touchEvent);
    public void Dispatch(ref MouseDownEventRef e);
    public void Dispatch(ref MouseUpEventRef e);
    public void Dispatch(ref MouseMoveEventRef e);
    public void CapturePointer(View view, int pointerId, IPointerGesture? gesture = null);
    public void ReleasePointer(View view, int pointerId);
    public IPointerGesture? GetCapturedGesture(int pointerId);
    public View? GetCapturedView(int pointerId);
    public void Dispatch(ref ScrollWheelEventRef e, Point position);
    public void Dispatch(ref ZoomEventRef e, Point position);
}

EventRouter.EventRouter(View rootView)

public EventRouter(View rootView);

Initializes a new Xui.Core.UI.Input.EventRouter rooted at the given view.

  • rootView — The root of the view tree to route events through.

void EventRouter.CapturePointer(View view, int pointerId, IPointerGesture? gesture = null)

public void CapturePointer(View view, int pointerId, IPointerGesture? gesture = null);

Captures all subsequent pointer events for the given pointer ID to view.

void EventRouter.Dispatch(ref MouseDownEventRef e)

public void Dispatch(ref MouseDownEventRef e);

Dispatches a mouse button down event as a pointer down event.

void EventRouter.Dispatch(ref MouseMoveEventRef e)

public void Dispatch(ref MouseMoveEventRef e);

Dispatches a mouse move event as a pointer move event.

void EventRouter.Dispatch(ref MouseUpEventRef e)

public void Dispatch(ref MouseUpEventRef e);

Dispatches a mouse button up event as a pointer up event.

void EventRouter.Dispatch(ref ScrollWheelEventRef e, Point position)

public void Dispatch(ref ScrollWheelEventRef e, Point position);

Dispatches a scroll wheel event to the deepest view under position that handles it, bubbling up until Xui.Core.Abstract.Events.ScrollWheelEventRef.Handled is set.

void EventRouter.Dispatch(ref TouchEventRef touchEvent)

public void Dispatch(ref TouchEventRef touchEvent);

Dispatches a touch event, translating each touch point into a pointer event.

void EventRouter.Dispatch(ref ZoomEventRef e, Point position)

public void Dispatch(ref ZoomEventRef e, Point position);

Routes magnification to the innermost view under the anchor, then its ancestors.

IPointerGesture? EventRouter.GetCapturedGesture(int pointerId)

public IPointerGesture? GetCapturedGesture(int pointerId);

Returns the gesture marker associated with the current capture for pointerId, or null if the pointer is not captured or was captured without a gesture marker.

View? EventRouter.GetCapturedView(int pointerId)

public View? GetCapturedView(int pointerId);

Returns the view currently holding pointer capture for pointerId, or null if the pointer is not captured.

void EventRouter.ReleasePointer(View view, int pointerId)

public void ReleasePointer(View view, int pointerId);

Releases pointer capture previously set by Xui.Core.UI.Input.EventRouter.CapturePointer(Xui.Core.UI.View,System.Int32,Xui.Core.UI.Input.IPointerGesture).

  • view — The view that currently holds the capture.

  • pointerId — The pointer identifier to release.

interface IDrag

A capturing view declares Xui.Core.UI.Input.IDrag when it is consuming pointer motion as ongoing input (e.g. a color wheel, a slider thumb, a drawing canvas). Ancestor scroll views and similar containers must not steal capture while an Xui.Core.UI.Input.IDrag gesture is active.

public interface IDrag : IPointerGesture
{
}

interface IDragHorizontalTentative

A horizontal-axis drag that is willing to yield capture to a vertical-axis ancestor whose drag intent appears stronger. Used by horizontal scroll views nested inside vertical ones: the inner scrolls horizontally from the first pointer move, but if the user's motion is dominantly vertical when crossing the recognition threshold, the outer scroll view steals capture.

The capturing view is expected to "promote" itself by re-capturing with a plain Xui.Core.UI.Input.IDrag (e.g. Xui.Core.UI.Input.PointerGestures.Drag) once horizontal motion has clearly committed to its axis (typical threshold: 20pt of horizontal travel). After promotion, vertical ancestors can no longer steal capture for this pointer.

public interface IDragHorizontalTentative : IDrag
{
}

interface IDragVerticalTentative

A vertical drag willing to yield to a horizontal ancestor until its direction commits. Promote to Xui.Core.UI.Input.PointerGestures.Drag once vertical intent is clear.

public interface IDragVerticalTentative : IDrag
{
}

interface IPointerGesture

Marker interface attached to a captured pointer to describe what kind of gesture the capturing view is performing. Ancestor views can inspect this (via Xui.Core.UI.Input.EventRouter.GetCapturedGesture(System.Int32)) to negotiate handover — for example a ScrollView will steal an Xui.Core.UI.Input.ITap after a drag threshold but stand down for an Xui.Core.UI.Input.IDrag.

public interface IPointerGesture
{
}

interface ITap

A capturing view declares Xui.Core.UI.Input.ITap when it is tracking a press that may or may not become a tap (e.g. Button, Checkbox). An ancestor that wants the pointer for a drag may steal capture after its own threshold is exceeded.

public interface ITap : IPointerGesture
{
}

enum PointerButton

Defines the mouse or pointer button associated with a pointer event, based on the W3C Pointer Events specification.

public enum PointerButton : short
{
    None = -1,
    Left = 0,
    Middle = 1,
    Right = 2,
    X1 = 3,
    X2 = 4,
    Eraser = 5,
}

PointerButton.Eraser

Eraser = 5

Pen eraser button (5).

PointerButton.Left

Left = 0

Left mouse button, touch contact, or pen contact (0).

PointerButton.Middle

Middle = 1

Middle mouse button (usually the scroll wheel button) (1).

PointerButton.None

None = -1

No button or touch/pen contact change occurred (-1).

PointerButton.Right

Right = 2

Right mouse button or pen barrel button (2).

PointerButton.X1

X1 = 3

X1 (back) mouse button (3).

PointerButton.X2

X2 = 4

X2 (forward) mouse button (4).

enum PointerButtons

Defines the set of mouse or pointer buttons currently pressed, based on the W3C Pointer Events specification.

[Flags]
public enum PointerButtons : short
{
    None = 0,
    Left = 1 << 0,
    Right = 1 << 1,
    Middle = 1 << 2,
    X1 = 1 << 3,
    X2 = 1 << 4,
    Eraser = 1 << 5,
}

PointerButtons.Eraser

Eraser = 1 << 5

Pen eraser button.

PointerButtons.Left

Left = 1 << 0

Left mouse button, touch contact, or pen contact.

PointerButtons.Middle

Middle = 1 << 2

Middle mouse button.

PointerButtons.None

None = 0

No buttons are currently pressed.

PointerButtons.Right

Right = 1 << 1

Right mouse button or pen barrel button.

PointerButtons.X1

X1 = 1 << 3

X1 (back) mouse button.

PointerButtons.X2

X2 = 1 << 4

X2 (forward) mouse button.

ref struct PointerEventRef

Represents a reference to a pointer event routed to a view, containing identification and pointer state information.

public ref struct PointerEventRef
{
    public readonly ReadOnlySpan<PointerGestureCandidate> PotentialGestures { get; }

    public readonly void PushPotentialGesture(View handler, IPointerGesture gesture);
    public readonly PointerEventType Type;
    public readonly int PointerId;
    public readonly long PersistentDeviceId;
    public readonly bool IsPrimary;
    public readonly PointerState State;
    public readonly ReadOnlySpan<PointerState> CoalescedStates;
    public readonly ReadOnlySpan<PointerState> PredictedStates;
    public readonly ITextMeasureContext? TextMeasure;
    public PointerEventRef(PointerEventType type, int pointerId, long persistentDeviceId, bool isPrimary, PointerState state, ReadOnlySpan<PointerState> coalescedStates, ReadOnlySpan<PointerState> predictedStates, ITextMeasureContext? textMeasure = null);
}

PointerEventRef.PointerEventRef(PointerEventType type, int pointerId, long persistentDeviceId, bool isPrimary, PointerState state, ReadOnlySpan<PointerState> coalescedStates, ReadOnlySpan<PointerState> predictedStates, ITextMeasureContext? textMeasure = null)

public PointerEventRef(PointerEventType type, int pointerId, long persistentDeviceId, bool isPrimary, PointerState state, ReadOnlySpan<PointerState> coalescedStates, ReadOnlySpan<PointerState> predictedStates, ITextMeasureContext? textMeasure = null);

Initializes a new instance of the Xui.Core.UI.Input.PointerEventRef struct.

ReadOnlySpan<PointerState> PointerEventRef.CoalescedStates

public readonly ReadOnlySpan<PointerState> CoalescedStates;

Gets high-frequency coalesced samples recorded between the last and current events.

bool PointerEventRef.IsPrimary

public readonly bool IsPrimary;

Gets a value indicating whether this pointer is the primary pointer in a multi-pointer interaction (e.g., first touch).

long PointerEventRef.PersistentDeviceId

public readonly long PersistentDeviceId;

Gets the persistent device ID, if known. Identifies the underlying hardware across multiple pointer sessions.

int PointerEventRef.PointerId

public readonly int PointerId;

Gets the unique ID of the pointer. Used to distinguish different active pointers (e.g., different fingers or pen tips).

readonly ReadOnlySpan<PointerGestureCandidate> PointerEventRef.PotentialGestures

public readonly ReadOnlySpan<PointerGestureCandidate> PotentialGestures { get; }

Up to eight handlers pushed earlier during this event's down tunnel, oldest first. Storage is shared by the routed event copies and exists only for this dispatch; do not retain this span across events.

ReadOnlySpan<PointerState> PointerEventRef.PredictedStates

public readonly ReadOnlySpan<PointerState> PredictedStates;

Gets future-predicted samples estimated from the current pointer movement.

readonly void PointerEventRef.PushPotentialGesture(View handler, IPointerGesture gesture)

public readonly void PushPotentialGesture(View handler, IPointerGesture gesture);

Advertises a possible gesture without capturing the pointer. Call during Down/Tunnel so descendants can adapt feedback while recognition is pending. When full, drops the oldest handler and retains the newest eight. This does not change capture or the handler's recognition rules.

PointerState PointerEventRef.State

public readonly PointerState State;

Gets the current physical state of the pointer (position, pressure, tilt, etc.).

ITextMeasureContext? PointerEventRef.TextMeasure

public readonly ITextMeasureContext? TextMeasure;

Optional text measure context for hit-testing text positions. May be null on platforms that do not provide one.

PointerEventType PointerEventRef.Type

public readonly PointerEventType Type;

Gets the type of pointer event (e.g., Down, Move, Up, Enter, Leave).

enum PointerEventType

Defines the type of action associated with a pointer event, based on the W3C Pointer Events specification.

public enum PointerEventType
{
    Over,
    Enter,
    Down,
    Move,
    Up,
    Cancel,
    Out,
    Leave,
    GotCapture,
    LostCapture,
}

PointerEventType.Cancel

Cancel

The pointer input was canceled by the system. Corresponds to the "pointercancel" event.

PointerEventType.Down

Down

A pointer button has been pressed. Corresponds to the "pointerdown" event.

PointerEventType.Enter

Enter

The pointer has entered the element or one of its descendants. Corresponds to the "pointerenter" event.

PointerEventType.GotCapture

GotCapture

The pointer has been captured by the element. Corresponds to the "gotpointercapture" event.

PointerEventType.Leave

Leave

The pointer has left the element and all its descendants. Corresponds to the "pointerleave" event.

PointerEventType.LostCapture

LostCapture

The pointer capture has been released from the element. Corresponds to the "lostpointercapture" event.

PointerEventType.Move

Move

The pointer has moved while being active. Corresponds to the "pointermove" event.

PointerEventType.Out

Out

The pointer has moved off of the element's hit region. Corresponds to the "pointerout" event.

PointerEventType.Over

Over

The pointer has moved onto the element's hit region. Corresponds to the "pointerover" event.

PointerEventType.Up

Up

A pointer button has been released. Corresponds to the "pointerup" event.

readonly record struct PointerGestureCandidate

A handler advertising a possible gesture during pointer-down tunneling.

  • Handler — The view which may later claim capture.

  • Gesture — The gesture it may recognize.

public readonly record struct PointerGestureCandidate(View Handler, IPointerGesture Gesture);

PointerGestureCandidate.PointerGestureCandidate(View Handler, IPointerGesture Gesture)

public PointerGestureCandidate(View Handler, IPointerGesture Gesture);

A handler advertising a possible gesture during pointer-down tunneling.

  • Handler — The view which may later claim capture.

  • Gesture — The gesture it may recognize.

IPointerGesture PointerGestureCandidate.Gesture

public IPointerGesture Gesture { get; init; }

The gesture it may recognize.

View PointerGestureCandidate.Handler

public View Handler { get; init; }

The view which may later claim capture.

class PointerGestures

Singleton gesture markers used by simple widgets when capturing a pointer. Reusing these avoids per-event heap allocation. Widgets that need to carry extra state can implement Xui.Core.UI.Input.IPointerGesture on their own type and pass an instance to CapturePointer instead.

public static class PointerGestures
{
    public static ITap Tap { get; }
    public static IDrag Drag { get; }
    public static IDragHorizontalTentative DragHorizontalTentative { get; }
    public static IDragVerticalTentative DragVerticalTentative { get; }
}

IDrag PointerGestures.Drag

public static IDrag Drag { get; }

Generic drag (e.g. color wheel, slider thumb) — ancestors must not steal.

IDragHorizontalTentative PointerGestures.DragHorizontalTentative

public static IDragHorizontalTentative DragHorizontalTentative { get; }

A horizontal-axis drag that is tentatively willing to yield to a vertical-axis ancestor (see Xui.Core.UI.Input.IDragHorizontalTentative). Replace with Xui.Core.UI.Input.PointerGestures.Drag once horizontal motion has firmly committed.

IDragVerticalTentative PointerGestures.DragVerticalTentative

public static IDragVerticalTentative DragVerticalTentative { get; }

A vertical drag that can yield to a horizontal ancestor before committing.

ITap PointerGestures.Tap

public static ITap Tap { get; }

Generic tap (e.g. Button, Checkbox) — may be stolen by an ancestor drag.

readonly struct PointerState

Describes the physical state of a pointer at a specific moment in time, including position, pressure, tilt, and button information.

public readonly struct PointerState
{
    public readonly Point Position;
    public readonly Size ContactSize;
    public readonly nfloat Pressure;
    public readonly bool HasPressure;
    public readonly nfloat TangentialPressure;
    public readonly Vector Tilt;
    public readonly nfloat Twist;
    public readonly nfloat AltitudeAngle;
    public readonly nfloat AzimuthAngle;
    public readonly PointerType PointerType;
    public readonly PointerButton Button;
    public readonly PointerButtons Buttons;
    public PointerState(Point position, Size contactSize, nfloat pressure, nfloat tangentialPressure, Vector tilt, nfloat twist, nfloat altitudeAngle, nfloat azimuthAngle, PointerType pointerType, PointerButton button, PointerButtons buttons, bool hasPressure = false);
    public PointerState WithPosition(Point position);
}

PointerState.PointerState(Point position, Size contactSize, NFloat pressure, NFloat tangentialPressure, Vector tilt, NFloat twist, NFloat altitudeAngle, NFloat azimuthAngle, PointerType pointerType, PointerButton button, PointerButtons buttons, bool hasPressure = false)

public PointerState(Point position, Size contactSize, nfloat pressure, nfloat tangentialPressure, Vector tilt, nfloat twist, nfloat altitudeAngle, nfloat azimuthAngle, PointerType pointerType, PointerButton button, PointerButtons buttons, bool hasPressure = false);

Initializes a new instance of the Xui.Core.UI.Input.PointerState struct.

  • position — The global position of the pointer.

  • contactSize — The size of the contact area.

  • pressure — The normalized pressure applied.

  • tangentialPressure — The normalized tangential (barrel) pressure applied.

  • tilt — The tilt vector of the pointer.

  • twist — The clockwise twist rotation of the pointer.

  • altitudeAngle — The altitude angle relative to the surface.

  • azimuthAngle — The azimuth angle (compass direction).

  • pointerType — The type of input device.

  • button — The button that triggered the event.

  • buttons — The set of currently pressed buttons.

  • hasPressure — Whether the source supplies real pressure measurements.

NFloat PointerState.AltitudeAngle

public readonly nfloat AltitudeAngle;

Gets the altitude angle of the pointer relative to the surface (0 = horizontal, π/2 = vertical), in radians.

NFloat PointerState.AzimuthAngle

public readonly nfloat AzimuthAngle;

Gets the azimuth angle (compass direction) of the pointer around the vertical axis, in radians.

PointerButton PointerState.Button

public readonly PointerButton Button;

Gets which button was responsible for triggering this pointer state change (left, right, middle, eraser, etc.).

PointerButtons PointerState.Buttons

public readonly PointerButtons Buttons;

Gets the set of all currently pressed buttons on the device.

Size PointerState.ContactSize

public readonly Size ContactSize;

Gets the size of the pointer's contact geometry, such as the area covered by a finger or stylus tip.

bool PointerState.HasPressure

public readonly bool HasPressure;

Whether Pressure is a device measurement rather than a synthesized button value.

PointerType PointerState.PointerType

public readonly PointerType PointerType;

Gets the type of device generating the pointer input (mouse, touch, pen, etc.).

Point PointerState.Position

public readonly Point Position;

Gets the position of the pointer in global (window) coordinates.

NFloat PointerState.Pressure

public readonly nfloat Pressure;

Gets the normalized pressure applied by the pointer (range: 0.0 to 1.0).

NFloat PointerState.TangentialPressure

public readonly nfloat TangentialPressure;

Gets the normalized tangential (barrel) pressure applied by the pointer (range: -1.0 to 1.0).

Vector PointerState.Tilt

public readonly Vector Tilt;

Gets the tilt of the pointer relative to the X and Y axes (in degrees).

NFloat PointerState.Twist

public readonly nfloat Twist;

Gets the clockwise twist (rotation) of the pointer around its major axis, in degrees (0.0 to 359.9).

PointerState PointerState.WithPosition(Point position)

public PointerState WithPosition(Point position);

Returns this state with a coordinate-space-specific position.

enum PointerType

Defines the type of input device associated with a pointer event.

public enum PointerType
{
    Mouse,
    Touch,
    Pen,
    Unknown,
}

PointerType.Mouse

Mouse

A mouse device generated the pointer event.

PointerType.Pen

Pen

A pen, stylus, or similar fine-point device generated the pointer event.

PointerType.Touch

Touch

A touch contact (e.g., finger or capacitive touch) generated the pointer event.

PointerType.Unknown

Unknown

The pointer device type could not be determined.

enum TextEditingChange

Changes reported before and after a text editing transaction.

[Flags]
public enum TextEditingChange
{
    Text = 1,
    Selection = 2,
}

TextEditingChange.Selection

Selection = 2

The insertion point or selected range changed.

TextEditingChange.Text

Text = 1

The document or marked text changed.

class TextEditingState

Single-line editing state shared by canvas text views and native input adapters. Offsets use UTF-16; selection and deletion respect Unicode grapheme boundaries.

public sealed class TextEditingState
{
    public event Action<TextEditingChange>? Changing;
    public event Action<TextEditingChange>? Changed;
    public Func<char, bool>? InputFilter { get; set; }
    public string Text { get; set; }
    public TextRange Selection { get; set; }
    public TextRange? MarkedRange { get; }

    public int Boundary(int offset);
    public int Previous(int offset);
    public int Next(int offset);
    public TextRange Normalize(TextRange range);
    public bool Insert(string value);
    public bool Replace(TextRange range, string value);
    public void DeleteBackward();
    public void DeleteForward();
    public void SetMarkedText(string value, TextRange relativeSelection);
    public void UnmarkText();
}

int TextEditingState.Boundary(int offset)

public int Boundary(int offset);

Finds the grapheme boundary at or before an offset.

event Action<TextEditingChange>? TextEditingState.Changed

public event Action<TextEditingChange>? Changed;

Raised after an editing transaction.

event Action<TextEditingChange>? TextEditingState.Changing

public event Action<TextEditingChange>? Changing;

Raised before an editing transaction, while old state is still readable.

void TextEditingState.DeleteBackward()

public void DeleteBackward();

Deletes the selection or the grapheme before the caret.

void TextEditingState.DeleteForward()

public void DeleteForward();

Deletes the selection or the grapheme after the caret.

Func<char, bool>? TextEditingState.InputFilter

public Func<char, bool>? InputFilter { get; set; }

Optional validation for committed input; composition is validated when committed.

bool TextEditingState.Insert(string value)

public bool Insert(string value);

Replaces the selection (or composition) atomically with committed input.

TextRange? TextEditingState.MarkedRange

public TextRange? MarkedRange { get; }

The provisional IME composition range, or null.

int TextEditingState.Next(int offset)

public int Next(int offset);

Finds the next grapheme boundary.

TextRange TextEditingState.Normalize(TextRange range)

public TextRange Normalize(TextRange range);

Normalizes a range, expanding a nonempty range to whole graphemes.

int TextEditingState.Previous(int offset)

public int Previous(int offset);

Finds the previous grapheme boundary.

bool TextEditingState.Replace(TextRange range, string value)

public bool Replace(TextRange range, string value);

Replaces a range with validated single-line input.

TextRange TextEditingState.Selection

public TextRange Selection { get; set; }

The normalized selection. Assignments are clamped to the document and grapheme boundaries.

void TextEditingState.SetMarkedText(string value, TextRange relativeSelection)

public void SetMarkedText(string value, TextRange relativeSelection);

Updates provisional IME text; the selection is relative to the marked text.

string TextEditingState.Text

public string Text { get; set; }

The document. Assignment ends composition and places the caret at the end.

void TextEditingState.UnmarkText()

public void UnmarkText();

Commits composition, or restores the pre-composition document if validation fails.

enum TextInputAction

An editing action from a software keyboard or its navigation controls.

public enum TextInputAction
{
    Default,
    Previous,
    Next,
    Done,
}

TextInputAction.Default

Default

Use the field's configured action; otherwise finish editing.

TextInputAction.Done

Done

Finish editing and release keyboard focus.

TextInputAction.Next

Next

Focus the next control, or finish editing at the end.

TextInputAction.Previous

Previous

Focus the preceding text input, without wrapping.

enum TextInputContentType

Semantic hints for platform suggestions and autofill.

public enum TextInputContentType
{
    None,
    Name,
    Password,
}

TextInputContentType.Name

Name

A person's name.

TextInputContentType.None

None

No specific semantic hint.

TextInputContentType.Password

Password

An existing password. Masking is controlled separately by IsPassword.

enum TextInputKeyboard

Keyboard layout hint. Character validation remains the editor's responsibility.

public enum TextInputKeyboard
{
    Text,
    Ascii,
    Number,
    Decimal,
}

TextInputKeyboard.Ascii

Ascii

ASCII letters, numbers and punctuation, for values such as hex colors.

TextInputKeyboard.Decimal

Decimal

Digits and a decimal separator.

TextInputKeyboard.Number

Number

Digits.

TextInputKeyboard.Text

Text

Ordinary text in the user's language.

class TextInputNavigation

Shared focus behavior for single-line editors and native keyboard actions.

public static class TextInputNavigation
{
    public static bool CanPerform(View view, TextInputAction action);
    public static void Perform(View view, TextInputAction action);
}

bool TextInputNavigation.CanPerform(View view, TextInputAction action)

public static bool CanPerform(View view, TextInputAction action);

Whether an action is available for the currently focused editor.

void TextInputNavigation.Perform(View view, TextInputAction action)

public static void Perform(View view, TextInputAction action);

Moves through focus order without wrapping, or dismisses the keyboard.

readonly record struct TextInputOptions

Platform-independent keyboard hints, read when a field receives focus. These do not restrict pasted, dictated, or hardware-keyboard input; use InputFilter for validation.

public readonly record struct TextInputOptions(TextInputKeyboard Keyboard = TextInputKeyboard.Text, TextInputContentType ContentType = TextInputContentType.None, TextInputAction ReturnAction = TextInputAction.Default);

TextInputOptions.TextInputOptions(TextInputKeyboard Keyboard = TextInputKeyboard.Text, TextInputContentType ContentType = TextInputContentType.None, TextInputAction ReturnAction = TextInputAction.Default)

public TextInputOptions(TextInputKeyboard Keyboard = TextInputKeyboard.Text, TextInputContentType ContentType = TextInputContentType.None, TextInputAction ReturnAction = TextInputAction.Default);

Platform-independent keyboard hints, read when a field receives focus. These do not restrict pasted, dictated, or hardware-keyboard input; use InputFilter for validation.

TextInputContentType TextInputOptions.ContentType

public TextInputContentType ContentType { get; init; }

TextInputKeyboard TextInputOptions.Keyboard

public TextInputKeyboard Keyboard { get; init; }

TextInputAction TextInputOptions.ReturnAction

public TextInputAction ReturnAction { get; init; }

readonly record struct TextRange

A UTF-16 range in a text document, with an exclusive end.

public readonly record struct TextRange(int Start, int End)
{
    public int Length { get; }
}

TextRange.TextRange(int Start, int End)

public TextRange(int Start, int End);

A UTF-16 range in a text document, with an exclusive end.

int TextRange.End

public int End { get; init; }

int TextRange.Length

public int Length { get; }

The number of UTF-16 code units in the range.

int TextRange.Start

public int Start { get; init; }