Component · Components
Canvas
Absolute-positioned child canvas.
@sharpts/gui 0.0.0-local · SharpTS 7c6010104a43Signature
TypeScript
Canvas(props: CanvasProps): GuiElementParameters
| Name | Type | Description |
|---|---|---|
props | CanvasProps | Absolute-positioned child canvas. |
Returns
GuiElement — Absolute-positioned child canvas.
Control metadata
Props
| Name | Type | Description |
|---|---|---|
ref | ControlRef<THandle> | Receives the retained native control handle. |
width | number | Preferred control width in device-independent pixels. Default: "NaN" |
height | number | Preferred control height in device-independent pixels. Default: "NaN" |
minWidth | number | Minimum permitted control width. Default: 0 |
minHeight | number | Minimum permitted control height. Default: 0 |
maxWidth | number | Maximum permitted control width. Default: "Infinity" |
maxHeight | number | Maximum permitted control height. Default: "Infinity" |
margin | Thickness | Space outside the control. Default: 0 |
horizontalAlignment | HorizontalAlignment | Horizontal alignment within the parent layout slot. Default: "stretch"Values: "left", "center", "right", "stretch" |
verticalAlignment | VerticalAlignment | Vertical alignment within the parent layout slot. Default: "stretch"Values: "top", "center", "bottom", "stretch" |
isVisible | boolean | Whether the control participates in rendering and layout. Default: true |
isEnabled | boolean | Whether the control accepts user interaction. Default: true |
opacity | number | Opacity from zero (transparent) to one (opaque). Default: 1 |
toolTip | string | Text shown when the pointer pauses over the control. |
automationName | string | Accessible automation name exposed to assistive technology and test drivers. |
classes | readonly string[] | Avalonia style classes applied to the native control. |
canvasLeft | number | Canvas left coordinate when parented by Canvas. Default: "NaN" |
canvasTop | number | Canvas top coordinate when parented by Canvas. Default: "NaN" |
gridRow | number | Zero-based row index when the control is placed in a Grid. Default: 0 |
gridColumn | number | Zero-based column index when the control is placed in a Grid. Default: 0 |
gridRowSpan | number | Number of Grid rows occupied by the control. Default: 1 |
gridColumnSpan | number | Number of Grid columns occupied by the control. Default: 1 |
dock | Dock | Edge used when the control is placed in a DockPanel. Default: "left"Values: "left", "top", "right", "bottom" |
onKeyDown | (event: KeyEvent) => boolean | Handles a normalized key-down event. |
onKeyUp | (event: KeyEvent) => boolean | Handles a normalized key-up event. |
capturePointerOnPress | boolean | Captures a pressed pointer until release, cancellation, unmount, or disposal. Default: false |
onPointerDown | (event: PointerEvent) => boolean | Handles a normalized pointer press. |
onPointerMove | (event: PointerEvent) => boolean | Handles normalized pointer movement. |
onPointerUp | (event: PointerEvent) => boolean | Handles a normalized pointer release. |
onPointerCancel | (event: PointerEvent) => boolean | Handles cancellation or loss of an active pointer capture using its last known local state. |
allowDrop | boolean | Allows native drag data to be dropped on this control. Default: false |
onDragOver | (event: DropEvent) => DropEffect | Chooses the accepted native drag effect. |
onDrop | (event: DropEvent) => void | Promise<unknown> | Receives normalized text and local-file drop data. |
Related symbols
Source
SharpTS.Gui.Sdk/GuiPackage/control-surface.generated.ts:467 at SharpTS revision 7c6010104a43c34d80e9d44704cf179bc4f5b8e0.