internal override void OnSelectionStartChanged(double oldSelectionStart, double newSelectionStart) { base.OnSelectionStartChanged(oldSelectionStart, newSelectionStart); if (!this.IsTemplateApplied) { return; } double calculatedSelectionStart = RangeSliderPrimitive.CalculateSelectionStart(this.Minimum, this.Maximum, this.SelectionStart, this.SelectionStart); this.SelectionStart = this.rangeSlider.Snap(calculatedSelectionStart); }
/// <summary> /// Called when the Framework <see cref="M:RadControl.OnApplyTemplate" /> is called. Inheritors should override this method should they have some custom template-related logic. /// This is done to ensure that the <see cref="P:IsTemplateApplied" /> property is properly initialized. /// </summary> protected override bool ApplyTemplateCore() { bool applied = base.ApplyTemplateCore(); this.rangeSliderPanel = this.GetTemplatePartField <RangeSliderPanel>(RangeSliderPanelName); applied = applied && this.rangeSliderPanel != null; this.rangeSlider = this.GetTemplatePartField <RangeSliderPrimitive>(RangeSliderPrimitivePartName); applied = applied && this.rangeSlider != null; this.scaleTopLeft = this.GetTemplatePartField <ScalePrimitive>(TopLeftScalePartName); applied = applied && this.scaleTopLeft != null; this.scaleBottomRight = this.GetTemplatePartField <ScalePrimitive>(BottomRightScalePartName); applied = applied && this.scaleBottomRight != null; return(applied); }
internal override void OnSelectionStartChanged(double oldSelectionStart, double newSelectionStart) { base.OnSelectionStartChanged(oldSelectionStart, newSelectionStart); if (!this.IsTemplateApplied) { return; } double calculatedSelectionStart = RangeSliderPrimitive.CalculateSelectionStart(this.Minimum, this.Maximum, this.SelectionStart, this.SelectionStart); this.SelectionStart = this.rangeSlider.Snap(calculatedSelectionStart); RadRangeSliderAutomationPeer peer = FrameworkElementAutomationPeer.FromElement(this) as RadRangeSliderAutomationPeer; if (peer != null) { peer.RaiseValuePropertyChangedEvent(oldSelectionStart, newSelectionStart); } }
/// <summary> /// Initializes a new instance of the RangeSliderPrimitiveAutomationPeer class. /// </summary> /// <param name="owner">The owner.</param> public RangeSliderPrimitiveAutomationPeer(RangeSliderPrimitive owner) : base(owner) { }