Adding Looping and Delays

19 Apr 20171 minute to read

Looping and delay can be enabled in SfRotator control and also we can customize the Text and Navigation direction.

Toggle AutoPlay

The EnableAutoPlay property specifies whether the items should navigate automatically based on NavigationDelay property, when the property value is set to true.

NOTE

By default, the property value is set to false.

  • C#
  • SfRotator rotator = new SfRotator(this);
    rotator.EnableAutoPlay = true;

    Setting Navigation Delay

    The NavigationDelay property specifies the delay duration while switching to next navigation item, when EnableAutoPlay property is enabled.

    NOTE

    The property value should be in milliseconds.

  • C#
  • SfRotator rotator = new SfRotator(this);
    rotator.NavigationDelay = 3000;

    Looping Items

    The EnableLooping property specifies whether the items should navigate to first item once it reaches the last item and vice-versa.

    NOTE

    Default value of EnableLooping in Rotator is true.

  • C#
  • SfRotator rotator = new SfRotator(this);
    rotator.EnableLooping = false;

    Restrict the Swiping

    Using EnableSwiping property , we can restrict the swiping gesture on Rotator’s Item. By enabling the EnableSwiping property , we can’t move the Rotator’s Item by swipe gesture.

    NOTE

    By default , this property is set to true.

  • C#
  • SfRotator rotator = new SfRotator(this);
    rotator.EnableSwiping = false;