| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | using System;using System.Collections.Generic;using System.Linq;using System.Text;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.UI.RecipeEditor{	/// <summary>	/// Interaction logic for UserNameInput.xaml	/// </summary>	public partial class UserNameInput : Window	{		public UserNameInput()		{			InitializeComponent();			this.textBox1.Focus();		}		/// <summary>		/// input changed		/// </summary>		/// <param name="sender"></param>		/// <param name="e"></param>		private void textBox1_TextChanged(object sender, TextChangedEventArgs e)		{			TextBox text = (TextBox)sender;			button1.IsEnabled = text.Text.TrimStart().TrimEnd().Length > 0;		}		public string UserName { get; set; }		/// <summary>		/// save name		/// </summary>		/// <param name="sender"></param>		/// <param name="e"></param>		private void button1_Click(object sender, RoutedEventArgs e)		{			UserName = textBox1.Text;			DialogResult = true;			this.Hide();		}	}}
 |