Table of Contents

Class Window

Namespace
Icy.UI.Controls
Assembly
IcyUI.dll

A modal dialog - a IsFocusScope that traps Tab/gamepad focus traversal within itself while IsOpen, and restores whatever was focused before it opened when it closes.

public class Window : ContentControl, INotifyPropertyChanging, IBindingTarget, INotifyPropertyChanged, INotifyFocusChanged, IContainerLayout
Inheritance
Window
Implements
Inherited Members
Extension Methods

Remarks

No backdrop/pointer-input isolation in v1 - opening a Window only traps keyboard/gamepad focus traversal (via IsFocusScope, see MoveFocus(bool)); elements behind it remain clickable. A caller wanting true pointer modality needs to layer that on top (e.g. a full-screen sibling element with a high enough ZIndex) - not attempted here.

Must be added to a Canvas (directly or nested) like any other element - there's no separate popup/overlay layer; position it (e.g. via ZIndex) as needed.

Constructors

Window()

Initializes a new instance of the Window class.

public Window()

Properties

IsOpen

Gets or sets a value indicating whether the window is open. Setting this also sets IsVisible and, when opening, focuses the window itself (if IsFocusable) or otherwise its first focusable descendant.

public bool IsOpen { get; set; }

Property Value

bool

Methods

Close()

Closes the window - equivalent to setting IsOpen to false.

public void Close()

OnClosed()

Raises Closed and restores whatever was focused before this window was entered (via CloseFocusScope(UIElement)).

protected virtual void OnClosed()

OnOpened()

Raises Opened and focuses this window (if focusable) or its first focusable descendant.

protected virtual void OnOpened()

Show()

Opens the window - equivalent to setting IsOpen to true.

public void Show()

Events

Closed

Occurs after the window closes (IsOpen becomes false).

public event EventHandler? Closed

Event Type

EventHandler

Opened

Occurs after the window opens (IsOpen becomes true).

public event EventHandler? Opened

Event Type

EventHandler