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
Apr 24, 2019
1 parent
6722fd6
commit 36c8142
Showing
6 changed files
with
121 additions
and
40 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
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
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
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
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,18 @@ | ||
<Page | ||
x:Class="PixivFSUWP.SettingsPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:PixivFSUWP" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
<ScrollViewer> | ||
<ScrollViewer.Background> | ||
<AcrylicBrush BackgroundSource="HostBackdrop" TintColor="White" TintOpacity="0.5" FallbackColor="White"/> | ||
</ScrollViewer.Background> | ||
<StackPanel Margin="0,75,0,0"> | ||
<Button x:Name="btnLogout" Click="BtnLogout_Click">注销登录</Button> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Page> |
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,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.Security.Credentials; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
using static PixivFSUWP.Data.OverAll; | ||
|
||
// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板 | ||
|
||
namespace PixivFSUWP | ||
{ | ||
/// <summary> | ||
/// 可用于自身或导航至 Frame 内部的空白页。 | ||
/// </summary> | ||
public sealed partial class SettingsPage : Page | ||
{ | ||
public SettingsPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void BtnLogout_Click(object sender, RoutedEventArgs e) | ||
{ | ||
var vault = new PasswordVault(); | ||
try | ||
{ | ||
vault.Remove(GetCredentialFromLocker(passwordResource)); | ||
vault.Remove(GetCredentialFromLocker(refreshTokenResource)); | ||
} | ||
catch { } | ||
finally | ||
{ | ||
((Frame.Parent as Grid).Parent as MainPage).Frame.Navigate(typeof(LoginPage)); | ||
} | ||
} | ||
} | ||
} |