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
ContentIWindowControlThe root control to render in the portal.
BoundsRectangleScreen-space position and size of the portal.
DismissOnClickOutsideboolWhether clicking outside the portal dismisses it.
ConsumeClickOnDismissboolWhether the dismissing click is consumed or passed through.
DimBackgroundboolWhether to dim the screen behind the portal.
OnDismissActionCallback invoked when the portal is dismissed.
OwnerIWindowControlThe control that owns this portal (for identification/cleanup).
BufferSizeSize?Buffer size for rendering. Defaults to Bounds size.
BufferOriginPoint?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
BufferOrigin
Screen coordinate that buffer (0,0) maps to. Defaults to Bounds.Location.
public Point? BufferOrigin { get; init; }
Property Value
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
Content
The root control to render in the portal.
public IWindowControl Content { get; init; }
Property Value
DimBackground
Whether to dim the screen behind the portal.
public bool DimBackground { get; init; }
Property Value
DismissOnClickOutside
Whether clicking outside the portal dismisses it.
public bool DismissOnClickOutside { get; init; }
Property Value
OnDismiss
Callback invoked when the portal is dismissed.
public Action? OnDismiss { get; init; }
Property Value
Owner
The control that owns this portal (for identification/cleanup).
public IWindowControl? Owner { get; init; }