Quellcode durchsuchen

搜索-完成清空搜索栏

zhuyi vor 1 Jahr
Ursprung
Commit
faa5f0dbe6

+ 14 - 0
PDF Office/ViewModels/BOTA/SearchContentViewModel.cs

@@ -95,6 +95,18 @@ namespace PDF_Office.ViewModels.BOTA
         public DelegateCommand<object> SearchChangedCommand { get; set; }
         public DelegateCommand CleanCommand { get; set; }
 
+        private string searchTextContext;
+
+        public string SearchTextContext
+        {
+            get { return searchTextContext; }
+            set
+            {
+                SetProperty(ref searchTextContext, value);
+            }
+        }
+
+
         #endregion
 
 
@@ -278,6 +290,8 @@ namespace PDF_Office.ViewModels.BOTA
 
         private void clean()
         {
+            SearchTextContext = "";
+            PDFViewer.ClearPageSelectText();
             SearchItemList.Clear();
             viewContentViewModel.OpenBOTA = false;
         }

+ 1 - 0
PDF Office/Views/BOTA/SearchContent.xaml

@@ -329,6 +329,7 @@
                 Height="32"
                 Padding="14,0,0,0"
                 HorizontalAlignment="Stretch"
+                Text="{Binding SearchTextContext,Mode=TwoWay}"
                 Initialized="TextBoxEx_Initialized"
                 KeyDown="TextBox_KeyDown">
                 <customControl:TextBoxEx.ContextMenu>