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

Commit

Permalink
将SearchResultPage中的内容与功能与WaterfallPage合并;不要再转圈了啊喂!
Browse files Browse the repository at this point in the history
  • Loading branch information
YukinoShary committed May 31, 2020
1 parent cd97665 commit d9fcfc3
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 343 deletions.
7 changes: 0 additions & 7 deletions PixivFSUWP/PixivFSUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,6 @@
<Compile Include="ViewModels\ImageItemViewModel.cs" />
<Compile Include="ViewModels\TagViewModel.cs" />
<Compile Include="ViewModels\WaterfallItemViewModel.cs" />
<Compile Include="SearchResultPage.xaml.cs">
<DependentUpon>SearchResultPage.xaml</DependentUpon>
</Compile>
<Compile Include="WaterfallPage.xaml.cs">
<DependentUpon>WaterfallPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -284,10 +281,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SearchResultPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="WaterfallPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
4 changes: 2 additions & 2 deletions PixivFSUWP/SearchPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@
</ItemsControl>
</StackPanel>
</Grid>
<ProgressRing x:Name="progressRing" Margin="0 75 0 0" VerticalAlignment="Center"
<!--ProgressRing x:Name="progressRing" Margin="0 75 0 0" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="75" Height="75" IsActive="True"/>
<ProgressRing x:Name="searchProgressRing" Margin="0 75 0 0" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="75" Height="75" IsActive="False"
Visibility="Collapsed"/>
Visibility="Collapsed"/-->
</Grid>
</Page>
40 changes: 17 additions & 23 deletions PixivFSUWP/SearchPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed partial class SearchPage : Page, IGoBackFlag
public SearchPage()
{
this.InitializeComponent();
_ = loadContents();
//_ = loadContents();
}

private bool _backflag { get; set; } = false;
Expand Down Expand Up @@ -79,8 +79,8 @@ protected override void OnNavigatedFrom(NavigationEventArgs e)
async Task loadContents()
{
var tags = await getTrendingTags();
progressRing.IsActive = false;
progressRing.Visibility = Visibility.Collapsed;
//progressRing.IsActive = false;
//progressRing.Visibility = Visibility.Collapsed;
stkMain.Visibility = Visibility.Visible;
panelTags.ItemsSource = tags;
}
Expand All @@ -95,8 +95,8 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
}
else
{
resultFrame.Navigate(typeof(SearchResultPage));
(resultFrame.Content as SearchResultPage).ItemsSource.CollectionChanged += ItemsSource_CollectionChanged;
resultFrame.Navigate(typeof(WaterfallPage));
//(resultFrame.Content as SearchResultPage).ItemsSource.CollectionChanged += ItemsSource_CollectionChanged;
grdSearchPanel.Visibility = Visibility.Collapsed;
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastIndex1 ||
cbSort.SelectedIndex != lastIndex2 || cbDuration.SelectedIndex != lastIndex3)
Expand All @@ -105,8 +105,8 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
lastIndex1 = cbSearchTarget.SelectedIndex;
lastIndex2 = cbSort.SelectedIndex;
lastIndex3 = cbDuration.SelectedIndex;
searchProgressRing.IsActive = true;
searchProgressRing.Visibility = Visibility.Visible;
//searchProgressRing.IsActive = true;
//searchProgressRing.Visibility = Visibility.Visible;
}
}
((Frame.Parent as Grid)?.Parent as MainPage)?.SelectNavPlaceholder(GetResourceString("SearchPagePlain"));
Expand All @@ -116,16 +116,16 @@ public async Task ShowSearch()
{
if (grdSearchPanel.Visibility == Visibility.Collapsed)
{
searchProgressRing.Visibility = Visibility.Collapsed;
searchProgressRing.IsActive = false;
//searchProgressRing.Visibility = Visibility.Collapsed;
//searchProgressRing.IsActive = false;
grdSearchPanel.Visibility = Visibility.Visible;
stkMain.Visibility = Visibility.Collapsed;
storyShow.Begin();
await Task.Delay(200);
}
else stkMain.Visibility = Visibility.Collapsed;
progressRing.IsActive = true;
progressRing.Visibility = Visibility.Visible;
//progressRing.IsActive = true;
//progressRing.Visibility = Visibility.Visible;
(panelTags.ItemsSource as List<ViewModels.TagViewModel>).Clear();
panelTags.ItemsSource = null;
await loadContents();
Expand All @@ -137,8 +137,8 @@ private async void TxtWord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQ
if (txtWord.Text.Trim() != lastWord || cbSearchTarget.SelectedIndex != lastIndex1 ||
cbSort.SelectedIndex != lastIndex2 || cbDuration.SelectedIndex != lastIndex3)
{
if (resultFrame.Content != null)
(resultFrame.Content as SearchResultPage).ItemsSource.CollectionChanged -= ItemsSource_CollectionChanged;
//if (resultFrame.Content != null)
//(resultFrame.Content as SearchResultPage).ItemsSource.CollectionChanged -= ItemsSource_CollectionChanged;
var param = new OverAll.SearchParam()
{
Word = txtWord.Text.Trim()
Expand Down Expand Up @@ -180,8 +180,8 @@ private async void TxtWord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQ
break;
}
OverAll.NewSearchResultList(param);
resultFrame.Navigate(typeof(SearchResultPage));
(resultFrame.Content as SearchResultPage).ItemsSource.CollectionChanged += ItemsSource_CollectionChanged;
resultFrame.Navigate(typeof(WaterfallPage));
//(resultFrame.Content as WaterfallPage).ItemsSource.CollectionChanged += ItemsSource_CollectionChanged;
}
storyFade.Begin();
await Task.Delay(200);
Expand All @@ -193,17 +193,11 @@ private async void TxtWord_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQ
lastIndex1 = cbSearchTarget.SelectedIndex;
lastIndex2 = cbSort.SelectedIndex;
lastIndex3 = cbDuration.SelectedIndex;
searchProgressRing.IsActive = true;
searchProgressRing.Visibility = Visibility.Visible;
//searchProgressRing.IsActive = true;
//searchProgressRing.Visibility = Visibility.Visible;
}
}

private void ItemsSource_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
searchProgressRing.Visibility = Visibility.Collapsed;
searchProgressRing.IsActive = false;
}

private void BtnTag_Click(object sender, RoutedEventArgs e)
{
txtWord.Text = (sender as Button).Tag as string;
Expand Down
81 changes: 0 additions & 81 deletions PixivFSUWP/SearchResultPage.xaml

This file was deleted.

Loading

0 comments on commit d9fcfc3

Please sign in to comment.