Slider with Ticks

This is one of the samples I did sometime back for showing the ticks. The code is compiled with Silverlight 3 beta but should work in Silverlight 2 also without any changes


you can find the source here


15 thoughts on “Slider with Ticks

  1. Nice, but I could not get this to run inside of Silverlight unless I adopted exactly the same layout…is there anyway to make this into a resource I can drag and drop into my grid?

  2. I tried this CustomeSlider class but throwing run time error at:
    bottomTicksCanvas.Children.Add(CreateTick(new Point(x1, 0), new Point(x1, 5)))

    Please help me


  3. I want through value into the slider, I replaced thumb with callout using style’s I am unable to get value into the callout plz help me

  4. If your Minimum is nonzero, you’ll need to CreateLabel based on:
    (int)Minimum + (int)Math.Round(((Maximum – Minimum) / numberOfTicks) * (i), 0)

  5. other solution when Minimum is nonzero,
    Initialize label with the minimum value and increment with thick value, like this:

    //before the for loop
    var label= Minimum;
    //inside the for loop
    bottomTicksCanvas.Children.Add(CreateLabel((Math.Round(ticksValue, 0)).ToString(), 6.0, x1));
    ticksValue += TickFrequency;

    ———————————- Line replaced:
    bottomTicksCanvas.Children.Add(CreateLabel((Math.Round(((Maximum – Minimum) / numberOfTicks) * (i), 0)).ToString(), 6.0, x1));

  6. how to implement above slider in windows phone 7? I tried to implement it, every thing is going fine except slider not showin on page.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s