private void ChangeValueInternal(bool toPositive)
        {
            NumericUpDownChangedRoutedEventArgs routedEvent = toPositive ?
                                                              new NumericUpDownChangedRoutedEventArgs(IncrementValueEvent, Interval) :
                                                              new NumericUpDownChangedRoutedEventArgs(DecrementValueEvent, -Interval);

            RaiseEvent(routedEvent);
            ChangeValueBy(routedEvent.Interval);

            _valueTextBox.CaretIndex = _valueTextBox.Text.Length;
        }
Beispiel #2
0
 private void txtQuantity_ValueDecremented(object sender, MahApps.Metro.Controls.NumericUpDownChangedRoutedEventArgs args)
 {
     try {
         int qty = ((int)(this.txtQuantity.Value == null ? 0 : this.txtQuantity.Value) - 1);
         this.lblTotalSaleAmt.Content  = totalSaleAmt = CalculateTotalPrice(qty, Convert.ToDouble(this.tbItemPrice.Text));
         this.txtAmtPaid.Text          = totalSaleAmt.ToString();
         this.sliderAmountPaid.Maximum = totalSaleAmt;
         this.sliderAmountPaid.Minimum = qty * purchase.PurchasePrice;
     }
     catch (Exception ex)
     {
         logger.LogException(ex);
     }
 }
        private void ChangeValueInternal(double interval)
        {
            NumericUpDownChangedRoutedEventArgs routedEvent = interval > 0 ?
                                                              new NumericUpDownChangedRoutedEventArgs(IncrementValueEvent, interval) :
                                                              new NumericUpDownChangedRoutedEventArgs(DecrementValueEvent, interval);

            RaiseEvent(routedEvent);

            if (!routedEvent.Handled)
            {
                ChangeValueBy(routedEvent.Interval);
                _valueTextBox.CaretIndex = _valueTextBox.Text.Length;
            }
        }
Beispiel #4
0
        private void ChangeValueInternal(double interval)
        {
            if (this.IsReadOnly)
            {
                return;
            }
            NumericUpDownChangedRoutedEventArgs numericUpDownChangedRoutedEventArg = (interval > 0 ? new NumericUpDownChangedRoutedEventArgs(NumericUpDown.ValueIncrementedEvent, interval) : new NumericUpDownChangedRoutedEventArgs(NumericUpDown.ValueDecrementedEvent, interval));

            base.RaiseEvent(numericUpDownChangedRoutedEventArg);
            if (!numericUpDownChangedRoutedEventArg.Handled)
            {
                this.ChangeValueBy(numericUpDownChangedRoutedEventArg.Interval);
                this._valueTextBox.CaretIndex = this._valueTextBox.Text.Length;
            }
        }