2018-02-27 18:26:37 +02:00
|
|
|
using System.Text.RegularExpressions;
|
2016-05-10 17:56:39 +03:00
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
|
|
|
|
namespace MtApi5TestClient
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for MainWindow.xaml
|
|
|
|
|
/// </summary>
|
2018-02-27 18:26:37 +02:00
|
|
|
public partial class MainWindow
|
2016-05-10 17:56:39 +03:00
|
|
|
{
|
2018-02-27 18:26:37 +02:00
|
|
|
private ViewModel Vm { get; }
|
2016-05-10 17:56:39 +03:00
|
|
|
|
|
|
|
|
public MainWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
2018-02-27 18:26:37 +02:00
|
|
|
Vm = new ViewModel();
|
|
|
|
|
_MainLayout.DataContext = Vm;
|
2016-05-10 17:56:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
|
|
{
|
2018-02-27 18:26:37 +02:00
|
|
|
Vm.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var regex = new Regex("[^0-9]+");
|
|
|
|
|
e.Handled = regex.IsMatch(e.Text);
|
2016-05-10 17:56:39 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|