/// <summary>
 /// Starts the hero image slide show.
 /// </summary>
 public void StartHeroImageSlideShow()
 {
     // Only start slideshow if we were able to get
     // any hero images
     if (HeroImages != null && HeroImages.Any())
     {
         _heroImageScrollTimer = new DispatcherTimer {
             Interval = TimeSpan.FromSeconds(7)
         };
         StartHeroImageSlideshowTimer();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Instantiates the hero image slideshow timer.
        /// </summary>
        public void InstantiateHeroImageSlideShowTimer()
        {
            // Only instantiate slideshow timer if we were able to get
            // any hero images
            if (HeroImages != null && HeroImages.Any())
            {
                _heroImageScrollTimer = new DispatcherTimer {
                    Interval = TimeSpan.FromSeconds(HeroImageScrollTimerInterval)
                };

                _heroImageScrollTimer.Tick += (s, e) =>
                {
                    var selectedIndex = HeroImages.IndexOf(SelectedHeroImage);
                    selectedIndex = (selectedIndex + 1) % HeroImages.Count;

                    SelectedHeroImage = HeroImages[selectedIndex];
                };
            }
        }