refactor: use control instead of DataContext to get input string

This commit is contained in:
leo 2024-12-03 09:33:06 +08:00
parent 0160600c75
commit ea0bec16da
No known key found for this signature in database

View file

@ -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);
}