Skip to content

ControlRepeater

Iuga Alexandru edited this page Sep 2, 2018 · 1 revision

Description

Displays a control repeatedly until it is explicitly stopped.

Features

  • It is a Control, too - The ControlRepeater is itself a Control and it has the same base behavior as any other control.
  • IRepeatableSupport - If the child Control implements the IRepeatableSupport interface additional support is offered.

Example

This example shows the ControlRepeater used to display a TextMenu.

ControlRepeater menuRepeater = new ControlRepeater
{
    Control = new TextMenu
    {
        Title = new TextBlock
        {
            Text = "Demo Application",
            ForegroundColor = ConsoleColor.Cyan,
            MarginBottom = 1
        },
        MarginTop = 1,
        MarginBottom = 1,
        EraseAfterClose = true
    }
};

menuRepeater.Display();

// Later...
menuRepeater.RequestClose();
Clone this wiki locally