Table of Contents

Class DesktopPortalOptions

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Options for creating a desktop portal.

public record DesktopPortalOptions : IEquatable<DesktopPortalOptions>
Inheritance
DesktopPortalOptions
Implements
Inherited Members
Extension Methods

Constructors

DesktopPortalOptions(IWindowControl, Rectangle, bool, bool, bool, Action?, IWindowControl?, Size?, Point?)

Options for creating a desktop portal.

public DesktopPortalOptions(IWindowControl Content, Rectangle Bounds, bool DismissOnClickOutside = true, bool ConsumeClickOnDismiss = true, bool DimBackground = false, Action? OnDismiss = null, IWindowControl? Owner = null, Size? BufferSize = null, Point? BufferOrigin = null)

Parameters

Content IWindowControl

The root control to render in the portal.

Bounds Rectangle

Screen-space position and size of the portal.

DismissOnClickOutside bool

Whether clicking outside the portal dismisses it.

ConsumeClickOnDismiss bool

Whether the dismissing click is consumed or passed through.

DimBackground bool

Whether to dim the screen behind the portal.

OnDismiss Action

Callback invoked when the portal is dismissed.

Owner IWindowControl

The control that owns this portal (for identification/cleanup).

BufferSize Size?

Buffer size for rendering. Defaults to Bounds size.

BufferOrigin Point?

Screen coordinate that buffer (0,0) maps to. Defaults to Bounds.Location.

Properties

Bounds

Screen-space position and size of the portal.

public Rectangle Bounds { get; init; }

Property Value

Rectangle

BufferOrigin

Screen coordinate that buffer (0,0) maps to. Defaults to Bounds.Location.

public Point? BufferOrigin { get; init; }

Property Value

Point?

BufferSize

Buffer size for rendering. Defaults to Bounds size.

public Size? BufferSize { get; init; }

Property Value

Size?

ConsumeClickOnDismiss

Whether the dismissing click is consumed or passed through.

public bool ConsumeClickOnDismiss { get; init; }

Property Value

bool

Content

The root control to render in the portal.

public IWindowControl Content { get; init; }

Property Value

IWindowControl

DimBackground

Whether to dim the screen behind the portal.

public bool DimBackground { get; init; }

Property Value

bool

DismissOnClickOutside

Whether clicking outside the portal dismisses it.

public bool DismissOnClickOutside { get; init; }

Property Value

bool

OnDismiss

Callback invoked when the portal is dismissed.

public Action? OnDismiss { get; init; }

Property Value

Action

Owner

The control that owns this portal (for identification/cleanup).

public IWindowControl? Owner { get; init; }

Property Value

IWindowControl