Slider

The Slider control provides a selector that you can use to set a particular value that is generally bound to another control. Chapter 34 provides an example binding a Slider to a MediaElement for controlling the volume; however, at the moment consider the following code:

image

A Slider requires a Minimum and Maximum value, whereas Value is the current selected value. You can place tool tips reporting the value (AutoToolTipPlacement) specifying the position (TopLeft or BottomRight). Moreover you can place ticks so that visualization is clearer and decide how many ticks to place (TickFrequency). For example, the preceding code can produce 10 ticks (one per possible value). The TextBlock simply shows the value of the slider via data-binding, which is generally the preferred way for binding a Slider value to another control. This object raises a ValueChanged event when the user moves the selector to another value. Figure 32.18 shows the result of the preceding code.

Figure 32.18 Setting values with a Slider.

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.108.197