views:

26

answers:

2

Hi all,

I'm using a WPF slider and have basically used it to implement a "Pull out control".

Basically it's a slider control with two positions: 0 and 1

I have this control on the far left side so what you initially see is the thumb position at 0. The user can then drag it out to the 1 position to see the full view of the slider thumb.

I have an issue where if you notice, the slider is laying over another control and since this is the case, we are unable to interact with the underlying control.

What I've tried:

Within the default style, I've tried to apply the HitTestVisible property on the track to be false; as well as other possible elements. However since the thumb, it would make the whole control not HitTest'able.

|*------|
0       1

Any ideas on how I can somehow make the slider control HitTestVisible=false while also making the Slider thumb HitTestVisible=true.

A: 

If you get rid of the increase and decrease buttons in the track, and you don't have a background set on the track itself, I'm not sure what would be capturing your input (other than the thumb). Are you trying to put additional controls within the thumb itself? If so, that probably wouldn't work very well and I think I'd look for another way.

I might be misunderstanding the details here, so maybe seeing some of your code would help. I'm not really clear what part of the slider is covering the controls you're trying to use.

Ben Reierson
A: 

So I've found the issue.

Essentially for all the elements within the Slider, you basically have to set the Background to:

 Background="{x:Null}" 

This not only makes it transparent, it also makes it not HitTestVisible, which means I can click through it.

Floetic