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
{
	/// 
	/// Interaction logic for UserNameInput.xaml
	/// 
	public partial class UserNameInput : Window
	{
		public UserNameInput()
		{
			InitializeComponent();
			this.textBox1.Focus();
		}
		/// 
		/// input changed
		/// 
		/// 
		/// 
		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; }
		/// 
		/// save name
		/// 
		/// 
		/// 
		private void button1_Click(object sender, RoutedEventArgs e)
		{
			UserName = textBox1.Text;
			DialogResult = true;
			this.Hide();
		}
	}
}