This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tobiichiamane
committed
May 25, 2019
1 parent
6008870
commit 5c49ac5
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace PixivFSUWP.Data | ||
{ | ||
public class Backstack : Stack<(Type, object)> | ||
{ | ||
public static Backstack Default; | ||
|
||
public bool CanBack | ||
{ | ||
get => base.Count > 0; | ||
} | ||
|
||
public void Push(Type Page, object Parameter) | ||
{ | ||
base.Push((Page, Parameter)); | ||
} | ||
|
||
public void Back(Frame Frame) | ||
{ | ||
if (!CanBack) throw new InvalidOperationException(); | ||
(var page, var param) = base.Pop(); | ||
Frame.Navigate(page, param); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters