Class ScreenStack
- Namespace
- MiniTui
- Assembly
- MiniTui.dll
The app's screens (§9.3). Only the top screen renders and receives keys; the ones below keep their state.
[SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix", Justification = "Name from the spec (§9.3); it is a stack.")]
public sealed class ScreenStack
- Inheritance
-
ScreenStack
- Inherited Members
Remarks
Changes made from another thread while the app runs are posted to the UI thread.
Properties
All
The screens, bottom first.
public IReadOnlyList<Screen> All { get; }
Property Value
Count
How many screens are on the stack.
public int Count { get; }
Property Value
Top
The screen on top, or null when the stack is empty.
public Screen? Top { get; }
Property Value
Methods
Pop()
Unmount the top screen and activate the new top. If that empties the stack and QuitWhenEmpty(bool) is on (the default), the app quits.
public void Pop()
PopTo(Screen)
Pop screens until screen is on top.
public void PopTo(Screen screen)
Parameters
screenScreen
Exceptions
- InvalidOperationException
screenisn't on the stack.
Push(Screen)
Mount screen, deactivate the previous top and activate the new one.
public void Push(Screen screen)
Parameters
screenScreen
Exceptions
- InvalidOperationException
The app has a Render(Action<Buffer, Rect>) callback, or the screen is already mounted.
Replace(Screen)
Pop the top screen and push screen, without activating the screen below in between.
public void Replace(Screen screen)
Parameters
screenScreen