Files
RookieStation/RookieStation/WpfExitGate.xaml.cs
2021-06-11 15:42:50 +08:00

60 lines
1.5 KiB
C#

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
{
/// <summary>
/// WpfExitGate.xaml 的交互逻辑
/// </summary>
public partial class WpfExitGate
{
public bool IsStartPassage { 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);
if (rbStartPassage.IsChecked == true)
{
PassageWidth = passageWidth;
IsStartPassage = true;
}
else if (rbStartInspection.IsChecked == true)
{
IsStartPassage = 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);
}
}
}