> For the complete documentation index, see [llms.txt](https://docs.dbnetsoft.com/dbnetsoft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnetsoft.com/dbnetsoft/screenspro/controls/carouselelement.md).

# CarouselElement

This element shows the items of a list one after another in a rotating carousel.

## Properties

| Name             | Type     | Description                                                                                                               |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `Data`           | IList    | The items to display, usually coming from a [source](/dbnetsoft/screenspro/sources.md). Setting it restarts the carousel. |
| `ChangeInterval` | TimeSpan | How long each item stays selected. Default 5 seconds.                                                                     |

The items are styled with the `ItemTemplate` of the underlying carousel.

## Items written in the layout

Instead of binding `Data`, the items can be written directly between the tags. They then need no `ItemTemplate`, because each one is already an element of its own:

```xml
<controls:CarouselElement ChangeInterval="0:00:03">
    <controls:ImageElement Filename="sponsor1.png" />
    <controls:ImageElement Filename="sponsor2.png" />
    <controls:ImageElement Filename="sponsor3.png" />
</controls:CarouselElement>
```

The two ways cannot be combined: setting `Data` on an element that already carries items from the layout raises an error, so use either the items or `Data`.

## Rotation

The carousel starts to rotate when the layout goes on air and stops when it is taken off air. Each time the last item has been passed, the element raises its finished event, which a sequence can react to, and starts over with the first item.
