7

Currently, the WPF slider has some properties that allow defining and viewing a single interval on a slider: SelectionStart, SelectionEnd and IsSelectionRangeEnabled.

By setting these values

<Slider Minimum="0" Maximum="300" Value="150" IsSelectionRangeEnabled="True" SelectionStart="50" SelectionEnd="200"/>

you get the selected interval in the slider, colored in blue, like this:

enter image description here

What I would like to do is to be able to define multiple intervals - e.g. (50-100), (110-130), (170-200) and (210-240), which would look like this:

enter image description here

Any ideas on how to aproach this issue or what template I should try modifying in order to get this feature?

4

2 に答える 2

2

これは答えではないかもしれませんが、回避策です。スライダーバーをキャンバスに配置してから、キャンバスに描画しますスライダーバーのセグメントを強調表示します

于 2013-02-19T03:14:32.627 に答える
0

Ticksプロパティを使用して、複数の間隔を設定します。上記の説明から、どのように機能させたいのか正確にはわかりませんが、ここに例を示します。

<Slider Minimum="0" Maximum="300" Value="150" 
IsSelectionRangeEnabled="True" SelectionStart="50" 
SelectionEnd="200" IsMoveToPointEnabled="True" 
TickPlacement="BottomRight" Ticks="50, 100, 105, 140, 150, 200" IsSnapToTickEnabled="True" />
于 2012-04-10T11:58:12.390 に答える