private static void OnCurrentValuePropertyChanged(DependencyObject element, DependencyPropertyChangedEventArgs args)
        {
            InstrumentationElement target = element as InstrumentationElement;

            if (target == null)
            {
                return;
            }
            target.OnCurrentValueChanged();
        }
        private static void OnForegroundPropertyChanged(DependencyObject element, DependencyPropertyChangedEventArgs args)
        {
            InstrumentationElement target = element as InstrumentationElement;

            if (target == null)
            {
                return;
            }
            Brush brush = (Brush)args.NewValue;

            target.OnForegroundChanged(brush);
        }
        private static void OnIsEnabledChanged(DependencyObject element, DependencyPropertyChangedEventArgs args)
        {
            InstrumentationElement target = element as InstrumentationElement;

            if (target == null)
            {
                return;
            }
            bool oldValue = (bool)args.OldValue;
            bool newValue = (bool)args.NewValue;

            target.OnIsEnabledChanged(oldValue, newValue);
        }
        private static object CoerceCurrentValue(DependencyObject element, object value)
        {
            InstrumentationElement target = element as InstrumentationElement;

            if (target == null)
            {
                throw new ArgumentNullException("element");
            }
            double targetValue = (double)value;

            if (DoubleUtil.LessThan(targetValue, 0))
            {
                return(0);
            }

            return(DoubleUtil.GreaterThan(targetValue, 100) ? 100 : targetValue);
        }