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
tobiichiamane committed Jun 27, 2020
1 parent bc18732 commit f2a1f13
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
4 changes: 4 additions & 0 deletions PixivFSUWP/DownloadManager.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
<ListViewItem>
<Grid>
<StackPanel Orientation="Horizontal">
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}"
Glyph="&#xE896;"/>
<TextBlock x:Uid="DownloadingCaption"/>
</StackPanel>
</Grid>
</ListViewItem>
<ListViewItem>
<Grid>
<StackPanel Orientation="Horizontal">
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}"
Glyph="&#xE8A5;"/>
<TextBlock x:Uid="DownloadedCaption"/>
</StackPanel>
</Grid>
Expand Down
29 changes: 27 additions & 2 deletions PixivFSUWP/DownloadManager.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using PixivFSUWP.Data;
using PixivFSUWP.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -20,11 +22,34 @@ namespace PixivFSUWP
/// <summary>
/// 可用于自身或导航至 Frame 内部的空白页。
/// </summary>
public sealed partial class DownloadManager : Page
public sealed partial class DownloadManager : Page, IGoBackFlag
{
bool _backflag = false;

public DownloadManager()
{
this.InitializeComponent();
}

public void SetBackFlag(bool value)
{
_backflag = value;
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
OverAll.TheMainPage.SelectNavPlaceholder(OverAll.GetResourceString("DownloadsPlain"));
}

protected override void OnNavigatedFrom(NavigationEventArgs e)
{
if (!_backflag)
{
Backstack.Default.Push(typeof(DownloadManager), null);
((Frame.Parent as Grid)?.Parent as MainPage)?.UpdateNavButtonState();
}
base.OnNavigatedFrom(e);
}
}
}
5 changes: 5 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,11 @@ Do you want to disable them?</target>
<target state="new">Downloading</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="DownloadsPlain" translate="yes" xml:space="preserve">
<source>Downloads</source>
<target state="new">Downloads</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
5 changes: 5 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,11 @@ Do you want to disable them?</source>
<target state="new">Downloading</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="DownloadsPlain" translate="yes" xml:space="preserve">
<source>Downloads</source>
<target state="new">Downloads</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
5 changes: 5 additions & 0 deletions PixivFSUWP/MultilingualResources/PixivFSUWP.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,11 @@ Do you want to disable them?</source>
<target state="new">Downloading</target>
<note from="MultilingualBuild" annotates="source" priority="2">TextBlock</note>
</trans-unit>
<trans-unit id="DownloadsPlain" translate="yes" xml:space="preserve">
<source>Downloads</source>
<target state="new">Downloads</target>
<note from="MultilingualBuild" annotates="source" priority="2">PlainText</note>
</trans-unit>
</group>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions PixivFSUWP/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
<value>Downloading ugoira</value>
<comment>PlainText</comment>
</data>
<data name="DownloadsPlain" xml:space="preserve">
<value>Downloads</value>
<comment>PlainText</comment>
</data>
<data name="Draw.Label" xml:space="preserve">
<value>Draw</value>
<comment>AppBarButton</comment>
Expand Down

0 comments on commit f2a1f13

Please sign in to comment.