namespace Gu.Wpf.UiAutomation
{
    using System.Windows.Automation;

    public class Thumb : UiElement
    {
        public Thumb(AutomationElement automationElement)
            : base(automationElement)
        {
        }

        public TransformPattern TransformPattern => this.AutomationElement.TransformPattern();

        /// <summary>
        /// Moves the slider horizontally.
        /// </summary>
        /// <param name="distance">+ for right, - for left.</param>
        public void SlideHorizontally(int distance)
        {
            Mouse.DragHorizontally(MouseButton.Left, this.Bounds.Center(), distance);
        }

        /// <summary>
        /// Moves the slider vertically.
        /// </summary>
        /// <param name="distance">+ for down, - for up.</param>
        public void SlideVertically(int distance)
        {
            Mouse.DragVertically(MouseButton.Left, this.Bounds.Center(), distance);
        }
    }
}

namespace Gu.Wpf.UiAutomation
{
    using System.Windows;
    using System.Windows.Automation;

    public class Thumb : UiElement
    {
        private const int DragSpeed = 500;

        public Thumb(AutomationElement automationElement)
            : base(automationElement)
        {
        }

        public TransformPattern TransformPattern => this.AutomationElement.TransformPattern();

        /// <summary>
        /// Moves the slider horizontally.
        /// </summary>
        /// <param name="distance">+ for right, - for left.</param>
        public void SlideHorizontally(int distance)
        {
            var cp = this.GetClickablePoint();
            Mouse.Drag(MouseButton.Left, cp, cp + new Vector(distance, 0), DragSpeed);
            Wait.UntilInputIsProcessed();
        }

        /// <summary>
        /// Moves the slider vertically.
        /// </summary>
        /// <param name="distance">+ for down, - for up.</param>
        public void SlideVertically(int distance)
        {
            var cp = this.GetClickablePoint();
            Mouse.Drag(MouseButton.Left, cp, cp + new Vector(0, distance), DragSpeed);
            Wait.UntilInputIsProcessed();
        }
    }
}

Fix SliderTest.SlideHorizontally on Win 10
Fix SliderTest.SlideHorizontally on Win 10

Fix #55
