Files
RookieStation/RookieStation/ParcelAreaModule/Views/WpfExitGate.xaml.cs
2021-12-03 18:21:26 +08:00

59 lines
1.6 KiB
C#

using HandyControl.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace RookieStation.ParcelAreaModule.Views
{
/// <summary>
/// WpfExitGate.xaml 的交互逻辑
/// </summary>
public partial class WpfExitGate
{
public bool StartWithPassage { get; set; }
public double PassageWidth { get; set; }
public WpfExitGate()
{
InitializeComponent();
}
private void btnConfirm_Click(object sender, RoutedEventArgs e)
{
double passageWidth;
bool a = double.TryParse(tbPassagewidth.Text, out passageWidth);
PassageWidth = passageWidth;
if (rbStartPassage.IsChecked == true)
{
StartWithPassage = true;
}
else if (rbStartInspection.IsChecked == true)
{
StartWithPassage = false;
}
if (a)
{
DialogResult = true;
}
//this.Close();
}
private void tb_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex("[^0-9]+");
e.Handled = re.IsMatch(e.Text);
}
}
}