0

I have a problem where a WPF slider is not functioning properly inside a scrollviewer. I believe this problem has been adressed here:

Slider \ ScrollViewer in a touch interface not working properly

The accepted answer is telling to retemplate the slider based on the custom thumb (created in a c# class).

Unfortunately whatever I do, I get problems.

to make things more difficult my slider is based on Mahapps and I found the slider style online:

https://github.com/robertbaker/Metro/blob/master/MahApps.Metro/Styles/Controls.Slider.xaml

So, I copied the entire Slider style into my App.Xaml. So far things work...

But When I try to modify the Thumb style by doing a "BasedOn":

<Style x:Key="HorizontalSliderThumb" TargetType="Thumb" BasedOn="{StaticResource CustomThumb}">

Nothing works....

I don't know what I'm doing wrong.

Help is appreciated !

Thank you,

user1841243
  • 1,663
  • 2
  • 19
  • 35

1 Answers1

1

Just add this to your xaml file

xmlns:custom="clr-namespace:<Namespace of custom controls>">

From there you can use

<custom:<name of custom component> />
Andre Motta
  • 759
  • 3
  • 16