Skip to end of metadata
Go to start of metadata

Remarks

The track in UXRangeSliderBar represents the range span of values that can be selected by user. The lowest possible value in UXRangeSliderBar is specified in Minimum property, while the highest possible value is specified in Maximum property. The LargeChange and SmallChange properties indicates the value to be added or subtracted from the value of UXRangeSliderBar.

Unlike UXSliderBar, UXRangeSliderBar uses two selection properties, SelectionStart and SelectionEnd, to indicate the selected range of values. By default, both properties are set to NaN, which means the range selection starts from the lowest possible value specified in Minimum property and ends at the highest possible value specified in Maximum property.

The following example shows how to define a simple UXRangeSliderBar in XAML.

View

Working with IsDragRangeEnabled Property

In UXRangeSliderBar, the area between the two UXThumb is the selected range of values, indicated by a blue track. By default this track is divided into two, middle increase and middle decrease button area. You can click on these areas to invoke the DecreaseLarge or IncreaseLarge commands.

Alternatively, you can enable another mode in UXRangeSliderBar using IsDragRangeEnabled property, which enables users to move the range selection track. In this mode, the DecreaseLarge and IncreaseLarge commands will not be invoked. You can drag the range selection area and both values of SelectionStart and SelectionEnd properties will be changed.

View

Working with MaximumRangeSpan Property and MinimumRangeSpan Property

You can set the minimum and maximum range span allowed in UXRangeSliderBar using MinimumRangeSpan and MaximumRangeSpan properties. When these properties are specified, the selected range value will be limited. You cannot select a range of value that is smaller than the value of MinimumRangeSpan property or larger than the value of MaximumRangeSpan property.

The following example shows how to set the minimum range span to 3 and the maximum range span to 5. Using this configuration, user cannot select a range of values smaller than 3 or larger than 5.

View
Note that this feature is applied to user interaction only. You can programmatically select a range of values that does not meet the minimum and maximum range span limitation.

Definition

public class UXRangeSliderBar : UXSliderBarBase

Summary

The following table summarizes the members exposed in this class.

Public Constructors

UXRangeSliderBar Constructor()Initializes a new instance of UXRangeSliderBar class.

Public Properties

EndThumbStyleGets or sets the style applied to the end UXThumb instance.
IsDragRangeEnabledGets or sets whether the selection range can be dragged.
MaximumRangeSpanGets or sets the maximum allowed range span of a specified selection in slider bar.
MinimumRangeSpanGets or sets the minimum allowed range span of a specified selection in slider bar.
SelectionEndGets or sets the largest value of a specified selection for a slider bar.
SelectionStartGets or sets the smallest value of a specified selection for a slider bar.
StartThumbStyleGets or sets the style applied to the start UXThumb instance.

Protected Properties

ProductProduct Info.

Fields

EndThumbStylePropertyIdentifies the EndThumbStyle dependency property.
IsDragRangeEnabledPropertyIdentifies the IsDragRangeEnabled dependency property.
MaximumRangeSpanPropertyIdentifies the MaximumRangeSpan dependency property.
MinimumRangeSpanPropertyIdentifies the MinimumRangeSpan dependency property.
SelectionEndPropertyIdentifies the SelectionEnd dependency property.
SelectionStartPropertyIdentifies the SelectionStart dependency property.
StartThumbStylePropertyIdentifies the StartThumbStyle dependency property.

Public Methods

AttachEventHandlers()Attaches the event handlers for UI elements in range slider bar.
DetachedEventHandlers()Detaches the event handlers for UI elements in range slider bar.
InitializeTemplates()Initializes the templates for range slider bar.
OnApplyTemplate()Builds the visual tree for the UXRangeSliderBar when a new template is applied.

Protected Methods

OnKeyUp(KeyEventArgs)Provides handling for key up action.
OnMaximumChanged(double, double)Provides handling when the value of Maximum property is changed.
OnMinimumChanged(double, double)Provides handling when the value of Minimum property is changed.
OnMouseWheel(MouseWheelEventArgs)Provides handling for mouse wheel action.
OnSelectionEndChanged(double, double)Provides handling when the value of SelectionEnd property is changed.
OnSelectionStartChanged(double, double)Provides handling when the value of SelectionStart property is changed.

Public Constructors

public UXRangeSliderBar()

Initializes a new instance of UXRangeSliderBar class.

Public Properties

public Style EndThumbStyle { get; set; }

Gets or sets the style applied to the end UXThumb instance.

public bool IsDragRangeEnabled { get; set; }

Gets or sets whether the selection range can be dragged.

public double MaximumRangeSpan { get; set; }

Gets or sets the maximum allowed range span of a specified selection in slider bar.

public double MinimumRangeSpan { get; set; }

Gets or sets the minimum allowed range span of a specified selection in slider bar.

public double SelectionEnd { get; set; }

Gets or sets the largest value of a specified selection for a slider bar.

public double SelectionStart { get; set; }

Gets or sets the smallest value of a specified selection for a slider bar.

public Style StartThumbStyle { get; set; }

Gets or sets the style applied to the start UXThumb instance.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty EndThumbStyleProperty

Identifies the EndThumbStyle dependency property.

public static readonly DependencyProperty IsDragRangeEnabledProperty

Identifies the IsDragRangeEnabled dependency property.

public static readonly DependencyProperty MaximumRangeSpanProperty

Identifies the MaximumRangeSpan dependency property.

public static readonly DependencyProperty MinimumRangeSpanProperty

Identifies the MinimumRangeSpan dependency property.

public static readonly DependencyProperty SelectionEndProperty

Identifies the SelectionEnd dependency property.

public static readonly DependencyProperty SelectionStartProperty

Identifies the SelectionStart dependency property.

public static readonly DependencyProperty StartThumbStyleProperty

Identifies the StartThumbStyle dependency property.

Public Methods

public void AttachEventHandlers()

Attaches the event handlers for UI elements in range slider bar.

public void DetachedEventHandlers()

Detaches the event handlers for UI elements in range slider bar.

public void InitializeTemplates()

Initializes the templates for range slider bar.

public void OnApplyTemplate()

Builds the visual tree for the UXRangeSliderBar when a new template is applied.

Protected Methods

protected void OnKeyUp(KeyEventArgs e)

Provides handling for key up action.

Parameters

eKey event args.

 

protected void OnMaximumChanged(double oldMaximum, double newMaximum)

Provides handling when the value of Maximum property is changed.

Parameters

oldMaximumSpecifies the old value of Maximum property.
newMaximumSpecifies the new value of Maximum property.

 

protected void OnMinimumChanged(double oldMinimum, double newMinimum)

Provides handling when the value of Minimum property is changed.

Parameters

oldMinimumSpecifies the old value of Minimum property.
newMinimumSpecifies the new value of Minimum property.

 

protected void OnMouseWheel(MouseWheelEventArgs e)

Provides handling for mouse wheel action.

Parameters

eMouseWheel event args.

 

protected void OnSelectionEndChanged(double oldValue, double newValue)

Provides handling when the value of SelectionEnd property is changed.

Parameters

oldValueSpecifies the old value of SelectionEnd property.
newValueSpecifies the new value of SelectionEnd property.

 

protected void OnSelectionStartChanged(double oldValue, double newValue)

Provides handling when the value of SelectionStart property is changed.

Parameters

oldValueSpecifies the old value of SelectionStart property.
newValueSpecifies the new value of SelectionStart property.

<Intersoft:UXRangeSliderBar TickPlacement="BottomRight" HandlesVisibility="Visible" SelectionStart="4" SelectionEnd="7" MinimumRangeSpan="3" MaximumRangeSpan="5" />
           

  • No labels