31 lines
874 B
C#
31 lines
874 B
C#
using Elwig.Helpers;
|
|
using System.Text.RegularExpressions;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Elwig.Dialogs {
|
|
public partial class LinearPriceIncreaseDialog : Window {
|
|
|
|
public double Price = 0.0;
|
|
|
|
public LinearPriceIncreaseDialog() {
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
|
DialogResult = true;
|
|
Price = double.Parse(PriceInput.Text.Replace("\u202f", ""));
|
|
Close();
|
|
}
|
|
|
|
private void UpdateButtons(ValidationResult res) {
|
|
ConfirmButton.IsEnabled = res.IsValid;
|
|
}
|
|
|
|
private void PriceInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
|
var res = Validator.CheckDecimal(PriceInput, true, 2, 8);
|
|
UpdateButtons(res);
|
|
}
|
|
}
|
|
}
|