OYXH\oyxh 2 лет назад
Родитель
Сommit
f9cb6be6bc

+ 2 - 2
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -107,8 +107,8 @@ namespace PDF_Office.ViewModels.BOTA
                 if (mouse.Source is TextBox)
                 {
                     TextBox textBox = (TextBox)mouse.Source;
-                    textBox.Select(textBox.Text.Length, 0);
-                    textBox.SelectAll();
+                    //textBox.Select(textBox.Text.Length, 0);
+                    //textBox.SelectAll();
                 }
             }
         }

+ 5 - 2
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -27,10 +27,13 @@ namespace PDF_Office.Views.BOTA
 
         private void TitleInput_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
         {
-            if (sender is TextBox)
+            if (sender is TextBox && IsLoaded)
             {
                 TextBox textBox = sender as TextBox;
-                textBox.Focus();
+                if (textBox.Visibility == Visibility.Visible)
+                {
+                    textBox.Focus();
+                }
             }
         }
     }