From a4431dab6068d9b6732768fa702f2d23aecb79b9 Mon Sep 17 00:00:00 2001 From: zggsong Date: Wed, 31 Jan 2024 16:17:28 +0800 Subject: [PATCH] fix: Unable to refresh after loading all the historical records. --- STranslate/ViewModels/Preference/HistoryViewModel.cs | 4 ++-- STranslate/Views/Preference/HistoryPage.xaml | 2 +- STranslate/Views/Preference/HistoryPage.xaml.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/STranslate/ViewModels/Preference/HistoryViewModel.cs b/STranslate/ViewModels/Preference/HistoryViewModel.cs index 7476f05f..d9374b40 100644 --- a/STranslate/ViewModels/Preference/HistoryViewModel.cs +++ b/STranslate/ViewModels/Preference/HistoryViewModel.cs @@ -30,9 +30,9 @@ public HistoryViewModel() /// 2. 在搜索过程中 /// 3. view列表总数等于数据库总数 /// - private bool CanLoadHistory => !IsLoading && string.IsNullOrEmpty(SearchContent) && (Count == 0 || HistoryList.Count != Count); + public bool CanLoadHistory => !IsLoading && string.IsNullOrEmpty(SearchContent) && (Count == 0 || HistoryList.Count != Count); - [RelayCommand(CanExecute = nameof(CanLoadHistory))] + [RelayCommand] private async Task LoadMoreHistoryAsync(ScrollViewer? scroll) { IsLoading = true; diff --git a/STranslate/Views/Preference/HistoryPage.xaml b/STranslate/Views/Preference/HistoryPage.xaml index 10b6a457..26d1a513 100644 --- a/STranslate/Views/Preference/HistoryPage.xaml +++ b/STranslate/Views/Preference/HistoryPage.xaml @@ -61,7 +61,7 @@ SelectedIndex="{Binding SelectedIndex}"> -