/// <summary> /// Reset the Slider to the Start/End /// </summary> /// <param name="isStart">Pass true to reset to start point</param> public void ResetSelection(bool isStart) { double widthChange = this.RangeStop - this.RangeStart; widthChange = isStart ? -widthChange : widthChange; RangeSliderBase.MoveThumb(this.leftButton, this.rightButton, widthChange); this.ReCalculateRangeSelected(true, true); }
/// <summary> /// Moves the current selection with x value /// </summary> /// <param name="isLeft">True if you want to move to the left</param> public void MoveSelection(bool isLeft) { double widthChange = RangeSliderBase.RepeatButtonMoveRatio * (this.RangeStopSelected - this.RangeStartSelected) * this.movableWidth / this.movableRange; widthChange = isLeft ? -widthChange : widthChange; RangeSliderBase.MoveThumb(this.leftButton, this.rightButton, widthChange); this.ReCalculateRangeSelected(true, true); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.txtMidRange = ((System.Windows.Controls.TextBlock)(target)); return; case 2: this.txtEndRange = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.rangeSliderBase = ((SequenceAssembler.RangeSliderBase)(target)); return; } this._contentLoaded = true; }
/// <summary> /// This method drags the thumb from the middle /// </summary> /// <param name="sender">Center thumb.</param> /// <param name="e">Event data.</param> private void CenterThumbDragDelta(object sender, DragDeltaEventArgs e) { RangeSliderBase.MoveThumb(this.leftButton, this.rightButton, e.HorizontalChange); }
/// <summary> /// Initializes a new instance of the RangeSelectionChangedEventArgs class. /// </summary> /// <param name="slider">The slider to get the info from</param> internal RangeSelectionChangedEventArgs(RangeSliderBase slider) : this(slider.RangeStartSelected, slider.RangeStopSelected) { }