icsharpcode / WpfDesigner

The WPF Designer from SharpDevelop
MIT License
958 stars 259 forks source link

GradientSlider's GradientStop can not be repositioned. #30

Closed openlisp closed 7 years ago

openlisp commented 7 years ago

The only working solution that has worked for me is following workaround in function thumb_DragDelta. . When dragged element is moved verticaly more than 50px It deleted. It allows to user insert new GradientStop to new position.

        void thumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            var stop = (e.OriginalSource as GradientThumb).GradientStop;
            if (e.VerticalChange > 50 && GradientStops.Count > 2)
            {
                GradientStops.Remove(stop);
            }
        }

image

jogibear9988 commented 7 years ago

The DragDrop of the Thumb is canceled by Wpf, I don't know why atm... Don't know if a assignment of a Thumbs offset stops a active DragDrop.

awraae commented 7 years ago

I have a fix for this in a local branch. I can make a pull request when I am back from vacation next week.

jogibear9988 commented 7 years ago

cool :-) would be nice! thx