Silverlight slider control that snaps - Microsoft User Experience Blog

Silverlight slider control that snaps

I came across a project where a slider control was needed that snapped to specific values. More than that, the value of the control also should reflect that. I came across the solution of Dave Relyea where he created a subclass of the Slider where OnValueChanged was overridden. The snap-distance is set with the SmallIncrement value of the Slider control. The problem I found with this solution was that the Value property still returned the actual position on the slider when dragging.

So, with the solution of Dave as a base, I made a simple addition. I added a SnapValue property in the subclass that returns the snap-value, even if you’re dragging the slider. Not revolutionary, but just what I needed. So if you need functionality like this, feel free to download the zip-file that contains the class-file. Just add that to your project. You might want to change the Namespace (now Mtirion.Toolbox) to your own project’s namespace.

Published 05 July 2011 02:28 PM door Martin Tirion
Opgeslagen onder: ,

Commentaar:

# Silverlight slider control that snaps said on 06 July, 2011 11:32 AM

PingBack vanaf  Silverlight slider control that snaps

Wat denkt u?

(Verplicht) 
(Verplicht) 
(Optioneel)
(Verplicht) 
CaptchaCube Vraag:


Antwoord:




Zoek

Go

Dit weblog

Nieuws

Selecteren