Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
更改全局变量命名
Browse files Browse the repository at this point in the history
  • Loading branch information
YukinoShary committed Jun 1, 2020
1 parent 178abc3 commit a2f8d44
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions PixivFSUWP/SearchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ namespace PixivFSUWP
public sealed partial class SearchPage : Page, IGoBackFlag
{
string lastWord = null;
int lastIndex1 = -1;
int lastIndex2 = -1;
int lastIndex3 = -1;
int lastSearchTarget = -1;
int lastSort = -1;
int lastDuration = -1;

public SearchPage()
{
Expand Down Expand Up @@ -104,8 +104,8 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
{
resultFrame.Navigate(typeof(WaterfallPage), e.Parameter);
grdSearchPanel.Visibility = Visibility.Collapsed;
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastIndex1 ||
cbSort.SelectedIndex != lastIndex2 || cbDuration.SelectedIndex != lastIndex3)
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastSearchTarget ||
cbSort.SelectedIndex != lastSort || cbDuration.SelectedIndex != lastDuration)
{
lastWord = txtWord.Text.Trim();
lastSearchTarget = cbSearchTarget.SelectedIndex;
Expand Down Expand Up @@ -138,8 +138,8 @@ public async Task ShowSearch()
private async void TxtWord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
{
if (string.IsNullOrWhiteSpace(txtWord.Text)) return;
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastIndex1 ||
cbSort.SelectedIndex != lastIndex2 || cbDuration.SelectedIndex != lastIndex3)
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastSearchTarget ||
cbSort.SelectedIndex != lastSort || cbDuration.SelectedIndex != lastDuration)
{
if (resultFrame.Content != null)
(resultFrame.Content as WaterfallPage).ItemsSource.CollectionChanged -= ItemsSource_CollectionChanged;
Expand Down Expand Up @@ -190,13 +190,13 @@ private async void TxtWord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQ
storyFade.Begin();
await Task.Delay(200);
grdSearchPanel.Visibility = Visibility.Collapsed;
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastIndex1 ||
cbSort.SelectedIndex != lastIndex2 || cbDuration.SelectedIndex != lastIndex3)
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastSearchTarget ||
cbSort.SelectedIndex != lastSort || cbDuration.SelectedIndex != lastDuration)
{
lastWord = txtWord.Text.Trim();
lastIndex1 = cbSearchTarget.SelectedIndex;
lastIndex2 = cbSort.SelectedIndex;
lastIndex3 = cbDuration.SelectedIndex;
lastSearchTarget = cbSearchTarget.SelectedIndex;
lastSort = cbSort.SelectedIndex;
lastDuration = cbDuration.SelectedIndex;
searchProgressRing.IsActive = true;
searchProgressRing.Visibility = Visibility.Visible;
}
Expand Down

0 comments on commit a2f8d44

Please sign in to comment.