private void XDimTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left && (XDimTextBox.CaretIndex == 0 || XDimTextBox.SelectionLength == XDimTextBox.Text.Length))
     {
         YDimTextBox.Focus();
     }
 }
 public Dialogue(bool dark, int N = 3, int M = 3)
 {
     InitializeComponent();
     if (dark)
     {
         dimWindow.Background  = new SolidColorBrush(Color.FromArgb(255, 34, 34, 34));
         label1.Foreground     = label2.Foreground = dimWindow.Foreground = new SolidColorBrush(Colors.White);
         dimWindow.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 80, 80, 80));
         dimWindow.Resources.Clear();
         dimWindow.Icon = new BitmapImage(new Uri(@"pack://application:,,,/images/ico_black.ico"));
     }
     YDimTextBox.Text = N.ToString();
     XDimTextBox.Text = M.ToString();
     YDimTextBox.Focus();
     YDimTextBox.SelectAll();
     focus = false;
 }