From ea0bec16dac1cc767d53089227b4f860c3b4b17d Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 3 Dec 2024 09:33:06 +0800 Subject: [PATCH] refactor: use control instead of DataContext to get input string --- src/Views/RevisionFiles.axaml.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Views/RevisionFiles.axaml.cs b/src/Views/RevisionFiles.axaml.cs index 007c58ef..f748fb0d 100644 --- a/src/Views/RevisionFiles.axaml.cs +++ b/src/Views/RevisionFiles.axaml.cs @@ -155,11 +155,7 @@ namespace SourceGit.Views private void OnSearchBoxTextChanged(object _, TextChangedEventArgs e) { - var vm = DataContext as ViewModels.CommitDetail; - if (vm == null) - return; - - if (string.IsNullOrEmpty(vm.RevisionFileSearchFilter)) + if (string.IsNullOrEmpty(TxtSearchRevisionFiles.Text)) FileTree.SetSearchResult(null); }