// Token: 0x06005F4A RID: 24394 RVA: 0x001AB80C File Offset: 0x001A9A0C private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RangeBase rangeBase = (RangeBase)d; RangeBaseAutomationPeer rangeBaseAutomationPeer = UIElementAutomationPeer.FromElement(rangeBase) as RangeBaseAutomationPeer; if (rangeBaseAutomationPeer != null) { rangeBaseAutomationPeer.RaiseValuePropertyChangedEvent((double)e.OldValue, (double)e.NewValue); } rangeBase.OnValueChanged((double)e.OldValue, (double)e.NewValue); }
/// <summary> /// MinimumProperty property changed handler. /// </summary> /// <param name="d">RangeBase that changed its Minimum.</param> /// <param name="e">DependencyPropertyChangedEventArgs.</param> /// private static void OnMinimumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RangeBase range = d as RangeBase; Debug.Assert(range != null); // Ensure it's a valid value if (!IsValidDoubleValue(e.NewValue)) { throw new ArgumentException(); } // Note: this section is a workaround, containing my // logic to hold all calls to the property changed // methods until after all coercion has completed // ---------- if (range._levelsFromRootCall == 0) { range._initialMax = range.Maximum; range._initialVal = range.Value; } range._levelsFromRootCall++; // ---------- range.CoerceMaximum(); range.CoerceValue(); // Note: this section completes my workaround to call // the property changed logic if all coercion has completed // ---------- range._levelsFromRootCall--; if (range._levelsFromRootCall == 0) { range.OnMinimumChanged((double)e.OldValue, (double)e.NewValue); // UIA event range.RaiseChangeEvent(Change.Minimum, (double)e.OldValue, (double)e.NewValue); double maximum = range.Maximum; if (range._initialMax != maximum) { range.OnMaximumChanged(range._initialMax, maximum); // UIA event range.RaiseChangeEvent(Change.Maximum, range._initialMax, maximum); } double value = range.Value; if (range._initialVal != value) { range.OnValueChanged(range._initialVal, value); } } // ---------- }
/// <summary> /// ValueProperty property changed handler. /// </summary> /// <param name="d">RangeBase that changed its Value.</param> /// <param name="e">DependencyPropertyChangedEventArgs.</param> private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RangeBase range = d as RangeBase; Debug.Assert(range != null); // Ensure it's a valid value if (!IsValidDoubleValue(e.NewValue)) { throw new ArgumentException(); } // Note: this section is a workaround, containing my // logic to hold all calls to the property changed // methods until after all coercion has completed // ---------- if (range._levelsFromRootCall == 0) { range._requestedVal = (double)e.NewValue; range._initialVal = (double)e.OldValue; } range._levelsFromRootCall++; // ---------- range.CoerceValue(); // Note: this section completes my workaround to call // the property changed logic if all coercion has completed // ---------- range._levelsFromRootCall--; if (range._levelsFromRootCall == 0) { double value = range.Value; if (range._initialVal != value) { range.OnValueChanged(range._initialVal, value); // Raises UIA event if (range.AutomationPeer != null) { range.AutomationPeer.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.ValueProperty, e.OldValue, e.NewValue); } } } // ---------- }