简体   繁体   中英

WPF three thumb slider?

May be you know a solution to implement tree thumb slider? I have one idea but it seems to be very sophisticated((.

Well, I dont know why my question is soo bad that it has -1 mark (???) I suppose it is not becouse it is difficult. Yes I need a THREE thumb slider. I need it for the histogramm control )). There is NO any more or less default controls in wpf that could work as histogramm. So I am writing it my own (the third variant - that is it =( - all previouse was not good for me) and I came here to find an idea what to do /

As for code - I have used for example this solution http://www.codeproject.com/KB/WPF/ImageLevels_CustomControl.aspx But his is NOT a three thumb slider - this is more like three sliders together. Anyway I dont like it and now I am trying to write some MaGiC template to make SIMPLE three thumb slider.

It should be fairly simple to implement. Create a Custom Control, add 3 dependency properties for your 3 thumb values. Maybe add the proper coercion for one thumb not exceding the value of the other thumbs. Now have a look of how the Track control in WPF works, you will need to implement something similiar to this control for your 3 way slider, which is properly the hardest part. A track having 3 Thumbs, disabling the vertical movement(or horizontal, depending on the orientation of the slider), deciding how to handle clicks on the track( simple slider makes the thumb jumping BigStep), moving only on the track, handling keyboard input, converting the positions into correct values etc..

Its difficult to tell more, without actually implementing it, but this would be the way i would start making it. Maybe there is a way to make this in xaml with a lot of dirty bindings or template magic, but sometimes its perfectly valid to just create a new control.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM