This is a migrated thread and some comments may be shown as answers.

Slider drags smoothly with mouse, not at all with touch

2 Answers 683 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Joe asked on 14 May 2019, 05:50 PM

I've got a slider bound to a double property.  The double property controls the opacity of a shape right next to my control

When I drag the center thumb with the mouse, everything works perfectly.  The opacity changes in 0.01 increments, the tooltip updates and the opacity changes.  It does all of this smoothly.

When I try to drag that same thumb via touch, it just doesn't work.  It basically seems to go from 0 to 1.  Even if I set both small and large change to 0.01 and disable SnapToTicks (it has no effect). It won't drag smoothly.  I've even tried styling the thumb to make it use a very large size (just to be sure it's not me missing it with touch).  Still doesn't work.

What property do I have to set to make the slider change smoothly with touch as it does with the mouse?

I've attached an image of me dragging the center slider with the mouse where it's working perfectly.  

Here is my XAML

<tk:RadSlider Grid.Row="8" Grid.Column="2" Grid.ColumnSpan="3"
              AutoToolTipPlacement="BottomRight"
              Minimum="0.0"
              Maximum="1.0"
              IsDeferredDraggingEnabled="False"
              Orientation="Horizontal"
              HorizontalAlignment="Center"
              SmallChange="0.01"
              Width="300"
              Margin="2 2 2 5"
              HandlesVisibility="Visible"
              Value="{Binding Source={x:Static core:Settings.Default}, Path=ShapeHandleOpacity, Mode=TwoWay}"
            />

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 17 May 2019, 07:53 AM
Hello Joe,

Thank you for the provided image and code snippet.

I tried replicating the same issue at my end, however, dragging via touch seems to work as expected. I've attached the sample project I used as well as a short recording of the result I observe for your reference.

Could you please try running the sample project on your touch device and let me know if you observe the issue with it? If that is not the case, could you please modify the project so that your custom styles are applied and the issue is reproduced and send it back to me?

If you do manage to replicate the issue with the sample project, could you please specify what device you're using so that I can test the behavior on a similar device at my end?

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 29 May 2019, 12:39 PM

After several intermittent attempts to look at your example and compare it to my code and trying to figure out where I was going wrong, the answer turned out to be absurdly dumb on my part.  

I migrated a custom style for this RadSlider from this XAML file to a shared ResourceDictionary recently;  It had so much useful stuff I wanted to make it the global default.  But in so doing, I inadvertently moved an EventSetter (for "ValueChanged") with code-behind that I'd meant to be only temporary, for testing.  The code-behind monkeyed with the bound double value.  And since the bound double value was in a global Settings object (not merely in some backing view-model), it still compiled.  I never noticed.

The net effect was that every single slider in my application was changing that specific double value (in addition to whatever it was bound to).  And the original slider was effectively fighting with itself:  Changing the value once via binding and a second time via the event setter.

I didn't realize this because I was only looking my specific slider and its properties, not the recently-promoted, global default style for it.

Sorry to waste your time.

 

Tags
Slider
Asked by
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Dilyan Traykov
Telerik team
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or