The slider control allows you to implement Carousel like functionality where you can swipe left and right to display different items:

The current naming of Slider control and Slider line control is a bit confusing. We will rename Sliderline control to Slider control, and Slider control to something like Scroll control in the future.

(Script tags will be stripped)


# Add list of items to slider control

Let's create three instances of the Dog class and use the list of dogs in the slider control. The Dog class looks like this.



## Setup the page

  1. Add the slider control and center it.

  2. Insert an image control within the slider control

  3. Add a label on top of the image control

  4. Add a button outside the label control

(Script tags will be stripped)


## Add code to main page

  1. Add the variable dogs that holds the list of dogs

  2. Add an event handler to capture swipe events

  3. Add an event to capture button click event

  4. Setup the dog array

The slide fires an SCDWidgetsSlideEvent when the slider control is swiped left or right:

a. Create a reference to slider and cast to **SCDWidgetsSlider** b. use the <Slider>.**onSlide** array to add a **SCDWidgetsSlideEventHandler** c. the SCDWidgetsSlideEvent has two attributes, **to** and **from**, to indicate the position change



## Bind to slider control using binding tab

a. bind list, name and imageUrl b. Important! Set the field **contentPriority** to false

(Script tags will be stripped)


# Slide to a specific item

The item count starts at zero, so to goto 2nd item, set <sliderControl>.selected = 1

# Slider app

(Script tags will be stripped)