#1,021 – Two Ways to Position Tick Marks on a Slider

You can cause tick marks to be displayed with a Slider control by setting the TickPlacement property.  By default, this places tick marks every 1 unit between the Minimum and Maximum values (inclusive).

There are two ways to change where tick marks are displayed on the Slider.  The first is to set the TickFrequency to indicate the desired spacing between tick marks.  When you set TickFrequency:

  • Tick mark is displayed at Minimum value
  • Tick marks are displayed at Minimum + TickFrequency and then every TickFrequency units
  • Tick mark is displayed at Maximum value

For example, if Minimum is 1, Maximum is 10, and TickFrequency is 2, we get tick marks at: 1, 3, 5, 7, 9, 10.

1021-001

The second method for configuring tick marks is to list a series of positions using the Ticks property.  Ticks are placed at the specified locations, as well as the Minimum and Maximum location.

        <Slider Minimum="1" Maximum="10"
                IsSnapToTickEnabled="True"
                TickPlacement="BottomRight"
                Ticks="2,4,6,8"/>

1021-002

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,021 – Two Ways to Position Tick Marks on a Slider

  1. Pingback: Dew Drop – March 5, 2014 (#1735) | Morning Dew

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: