Class ScrollingMenu
- Namespace
- ConsoleAppVisuals.InteractiveElements
- Assembly
- ConsoleAppVisuals.dll
The ScrollingMenu is an interactive element that displays a question with multiple scrollable choices.
public class ScrollingMenu : InteractiveElement<int>
- Inheritance
-
ScrollingMenu
- Inherited Members
Remarks
For more information, consider visiting the documentation available here.
Constructors
ScrollingMenu(string, int, Placement, params string[])
The ScrollingMenu is an interactive element that displays a question with multiple scrollable choices.
public ScrollingMenu(string question, int defaultIndex = 0, Placement placement = Placement.TopCenter, params string[] choices)
Parameters
question
stringThe question to ask the user.
defaultIndex
intThe index of the default choice(initially 0).
placement
PlacementThe placement of the menu on the console.
choices
string[]The different choices of the menu.
Remarks
For more information, consider visiting the documentation available here.
Properties
Choices
Gets the different choices of the menu.
public string[] Choices { get; }
Property Value
- string[]
DefaultIndex
Gets the index of the default choice.
public int DefaultIndex { get; }
Property Value
Height
Gets the height of the menu.
public override int Height { get; }
Property Value
Placement
Gets the placement of the menu on the console.
public override Placement Placement { get; }
Property Value
Question
Gets the question to ask the user.
public string Question { get; }
Property Value
Selector
Gets the selector char of the menu.
public char Selector { get; }
Property Value
Width
Gets the width of the menu.
public override int Width { get; }
Property Value
Methods
RenderElementActions()
Defines the actions to perform when the element is called to be rendered on the console.
[Visual]
protected override void RenderElementActions()
UpdateChoices(params string[])
Updates the choices of the menu.
public void UpdateChoices(params string[] choices)
Parameters
choices
string[]The new choices of the menu.
Remarks
For more information, consider visiting the documentation available here.
UpdateDefaultIndex(int)
Updates the default index of the menu.
public void UpdateDefaultIndex(int defaultIndex)
Parameters
defaultIndex
intThe new default index of the menu.
Remarks
For more information, consider visiting the documentation available here.
UpdatePlacement(Placement)
Updates the placement of the menu.
public void UpdatePlacement(Placement placement)
Parameters
placement
PlacementThe new placement of the menu.
Remarks
For more information, consider visiting the documentation available here.
UpdateQuestion(string)
Updates the question of the menu.
public void UpdateQuestion(string question)
Parameters
question
stringThe new question of the menu.
Remarks
For more information, consider visiting the documentation available here.
UpdateSelector(char)
Updates the selector of the menu.
public void UpdateSelector(char selector = '▶')
Parameters
selector
charThe new selector of the menu.
Remarks
For more information, consider visiting the documentation available here.