Exemple #1
0
        /// <summary>
        /// Coerces the NumberOfStars value.
        /// </summary>
        private static object CoerceNumberOfStarsValue(DependencyObject d, object value)
        {
            RatingsControl ratingsControl = (RatingsControl)d;
            Int32          current        = (Int32)value;

            if (current < ratingsControl.Minimum)
            {
                current = ratingsControl.Minimum;
            }
            if (current > ratingsControl.Maximum)
            {
                current = ratingsControl.Maximum;
            }
            return(current);
        }
Exemple #2
0
        /// <summary>
        /// Coerces the Value value.
        /// </summary>
        private static object CoerceValueValue(DependencyObject d, object value)
        {
            RatingsControl ratingsControl = (RatingsControl)d;
            Decimal        current        = (Decimal)value;

            if (current < ratingsControl.Minimum)
            {
                current = ratingsControl.Minimum;
            }
            if (current > ratingsControl.Maximum)
            {
                current = ratingsControl.Maximum;
            }
            return(current);
        }