123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using Aitex.Core.UI.View.Common;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- 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.Shapes;
- namespace Aitex.Sorter.UI.Views
- {
- /// <summary>
- /// RecipeNameDialog.xaml 的交互逻辑
- /// </summary>
- public partial class RecipeNameDialog : Window, IBaseView
- {
- public RecipeNameDialog(string name = null)
- {
- InitializeComponent();
- tbInput.Text = name;
- btnOk.IsEnabled = name != null;
- }
- private void tbInput_TextChanged(object sender, TextChangedEventArgs e)
- {
- btnOk.IsEnabled = IsValidFileName(tbInput.Text);
- }
- private void btnOk_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = true;
- }
- private void btnCancel_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = false;
- }
- public string RecipeName
- {
- get
- {
- return tbInput.Text.Trim();
- }
- }
- bool IsValidFileName(string strIn)
- {
- return !string.IsNullOrWhiteSpace(strIn);
- }
- }
- }
|