// The rest...

        protected override void ConvertText2Value()
        {
            (int precision, int scale) = InputDecimal.GetPrecisionAndScale(this.Mask);

            string completedtext = AutoCompletionTools.AutoCompleteDecimal(this.Text, false, precision, scale);

            completedtext = completedtext.Trim();

            bool valid = decimal.TryParse(completedtext, out decimal value_candidate);

            if (valid == false)
            {
                return;
            }

            if (Decimal.TryParse(this.MinValue, out Decimal minvalue))
            {
                if (value_candidate < minvalue)
                {
                    return;
                }
            }

            if (Decimal.TryParse(this.MaxValue, out Decimal maxvalue))
            {
                if (value_candidate > maxvalue)
                {
                    return;
                }
            }

            this.Value = value_candidate;
        }
 private void OnMaskPropertyChanged(DependencyPropertyChangedEventArgs args)
 {
     InputDecimal.ValidateMask(args.NewValue as string);
 }