示例#1
0
 private static void _OnToggleShuffleCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             e.CanExecute = true;
             e.Handled    = true;
         }
     }
 }
示例#2
0
 /// <summary>
 /// Executed event handler for resume command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnResumeCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             slideShow.StartTimer();
             e.Handled = true;
         }
     }
 }
示例#3
0
 /// <summary>
 /// Can execute handler for resume command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnResumeCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             e.CanExecute = slideShow.Paused;
             e.Handled    = true;
         }
     }
 }
示例#4
0
 private static void _OnToggleShuffleCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             // Stop the timer, change the photo, move to the next photo and restart timer
             slideShow.IsShuffled = !slideShow.IsShuffled;
             e.Handled            = true;
         }
     }
 }
示例#5
0
 /// <summary>
 /// Can execute handler for stop command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnStopCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             // Slide show can always stop and navigate to current photo
             e.CanExecute = true;
             e.Handled    = true;
         }
     }
 }
示例#6
0
 /// <summary>
 /// Executed event handler for previous slide command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnPreviousSlideCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             // Stop the timer, change the photo, move to the next photo and restart timer
             slideShow.MovePrevious();
             e.Handled = true;
         }
     }
 }
示例#7
0
 /// <summary>
 /// Can execute handler for previous slide command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnPreviousSlideCommandCanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             // Since slide show wraps around, this can always execute
             e.CanExecute = true;
             e.Handled    = true;
         }
     }
 }
示例#8
0
 /// <summary>
 /// Executed event handler for pause command
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">Event arguments describing the event.</param>
 private static void OnPauseCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     if (!e.Handled)
     {
         PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
         if (slideShow != null)
         {
             slideShow.StopTimer();
             slideShow.ClearValue(FrameworkElement.CursorProperty);
             e.Handled = true;
         }
     }
 }
示例#9
0
        /// <summary>
        /// Executed event handler for TogglePlayPause command
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Event arguments describing the event.</param>
        private static void OnPlayPauseCommandExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            if (!e.Handled)
            {
                PhotoSlideShowControl slideShow = sender as PhotoSlideShowControl;
                if (slideShow.Paused)
                {
                    OnResumeCommandExecuted(sender, e);
                }
                else
                {
                    OnPauseCommandExecuted(sender, e);
                }

                e.Handled = true;
            }
        }