private static object CoerceMaximum(DependencyObject d, object baseValue)
        {
            ProgressBar2D ctrl = (ProgressBar2D)d;
            double        min  = ctrl.Minimum;

            if ((double)baseValue < min)
            {
                return(min);
            }
            return(baseValue);
        }
        private static object CoerceValue(DependencyObject d, object baseValue)
        {
            ProgressBar2D ctrl = (ProgressBar2D)d;
            double        min  = ctrl.Minimum;
            double        v    = (double)baseValue;

            if (v < min)
            {
                return(min);
            }

            double max = ctrl.Maximum;

            if (v > max)
            {
                return(max);
            }

            return(baseValue);
        }