Add PaymentChartWindow
This commit is contained in:
30
Elwig/Dialogs/LinearPriceIncreaseDialog.xaml.cs
Normal file
30
Elwig/Dialogs/LinearPriceIncreaseDialog.xaml.cs
Normal file
@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user