/// <summary>Helper for setting <see cref="SpinUpdateModeProperty"/> on <paramref name="element"/>.</summary>
        /// <param name="element"><see cref="DependencyObject"/> to set <see cref="SpinUpdateModeProperty"/> on.</param>
        /// <param name="value">SpinUpdateMode property value.</param>
        public static void SetSpinUpdateMode(DependencyObject element, SpinUpdateMode value)
        {
            if (element is null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(SpinUpdateModeProperty, value);
        }
 protected BoxVm()
 {
     this.min            = DefaultValue(x => x.MinValue);
     this.max            = DefaultValue(x => x.MaxValue);
     this.culture        = DefaultValue(x => x.Culture);
     this.numberStyles   = DefaultValue(x => x.NumberStyles);
     this.decimalDigits  = DefaultValue(x => (x as DecimalDigitsBox <TValue>)?.DecimalDigits);
     this.allowSpinners  = DefaultValue(x => x.AllowSpinners);
     this.spinUpdateMode = DefaultValue(x => x.SpinUpdateMode);
     this.isReadOnly     = DefaultValue(x => x.IsReadOnly);
     this.increment      = DefaultValue(x => x.Increment);
     this.regexPattern   = DefaultValue(x => x.RegexPattern);
 }
 /// <summary>
 /// Set a value that specifies how the IncreaseCommand and DecreaseCommand behaves.
 /// The default is AsBinding meaning the value updates using the UpdateSourceTrigger specified in the binding. Default is LostFocus.
 /// If set to PropertyChanged the binding source will be updated at each click even if the binding has UpdateSourceTrigger = LostFocus
 /// </summary>
 public static void SetSpinUpdateMode(DependencyObject element, SpinUpdateMode value)
 {
     element.SetValue(SpinUpdateModeProperty, value);
 }