Table of Contents

Class DesktopPortal

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

A desktop-level portal that renders above all windows. Portals are lightweight render overlays managed by DesktopPortalService.

public class DesktopPortal
Inheritance
DesktopPortal
Inherited Members
Extension Methods

Fields

IsDirty

Thread-safe dirty flag — background threads may trigger Invalidate.

public volatile bool IsDirty

Field Value

bool

Properties

Bounds

Screen-space position and size.

public Rectangle Bounds { get; set; }

Property Value

Rectangle

BufferOrigin

Screen coordinate that buffer position (0,0) maps to. Defaults to Bounds.Location for backwards compatibility. Set to DesktopUpperLeft when the buffer needs to cover space above the portal (e.g., Start Menu).

public Point BufferOrigin { get; }

Property Value

Point

BufferSize

Buffer size for rendering. When larger than Bounds, allows portal children (submenus) to extend beyond the primary content area. Defaults to Bounds size.

public Size BufferSize { get; }

Property Value

Size

ConsumeClickOnDismiss

Whether the dismissing click is consumed or passed through.

public bool ConsumeClickOnDismiss { get; }

Property Value

bool

Content

The root control rendered in this portal.

public IWindowControl Content { get; }

Property Value

IWindowControl

DimBackground

Whether to dim the screen behind the portal.

public bool DimBackground { get; }

Property Value

bool

DismissOnClickOutside

Whether clicking outside dismisses this portal.

public bool DismissOnClickOutside { get; }

Property Value

bool

HasRendered

Whether this portal has been rendered at least once (has valid control bounds and buffer).

public bool HasRendered { get; }

Property Value

bool

Id

Unique identifier for this portal.

public string Id { get; }

Property Value

string

OnDismiss

Callback invoked when the portal is dismissed.

public Action? OnDismiss { get; }

Property Value

Action

Owner

The control that owns this portal.

public IWindowControl? Owner { get; }

Property Value

IWindowControl

RootNode

DOM tree root for layout and rendering.

public LayoutNode RootNode { get; }

Property Value

LayoutNode

ZOrder

Stacking order among portals (higher = on top).

public int ZOrder { get; }

Property Value

int