private void DurationTextBox_ValueIncremented(object sender, MahApps.Metro.Controls.NumericUpDownChangedRoutedEventArgs args) { if (DurationTextBox.Value == null) { DurationTextBox.Value = TimerLabConstants.DefaultDisplayDuration; } double value = Math.Round(DurationTextBox.Value.Value, 2); int integerPart = (int)value; double fractionalPart = value - integerPart; if (Math.Round(fractionalPart, 2) == TimerLabConstants.FractionalIncrementUpperBound) { DurationTextBox.Value = integerPart + TimerLabConstants.FractionalIncrementOffset; } }
private void txtQuantity_ValueIncremented(object sender, MahApps.Metro.Controls.NumericUpDownChangedRoutedEventArgs args) { this.lblTotalPurchaseAmt.Content = CalculateTotalPrice(((this.txtQuantity.Value == null ? 0 : this.txtQuantity.Value) + 1).ToString(), this.lblPrice.Content.ToString()); }