diff --git a/PixivFSUWP/MainPage.xaml.cs b/PixivFSUWP/MainPage.xaml.cs index 3448d85..8ed4cd9 100644 --- a/PixivFSUWP/MainPage.xaml.cs +++ b/PixivFSUWP/MainPage.xaml.cs @@ -87,9 +87,10 @@ public async void SelectNavPlaceholder(string title) NavSelect(5); } - private void BtnSetting_Click(object sender, RoutedEventArgs e) + private async void BtnSetting_Click(object sender, RoutedEventArgs e) { - ContentFrame.Navigate(typeof(SettingsPage), null, App.FromRightTransitionInfo); + //ContentFrame.Navigate(typeof(SettingsPage), null, App.FromRightTransitionInfo); + await new SettingsDialog().ShowAsync(); } private async void Page_Loaded(object sender, RoutedEventArgs e) diff --git a/PixivFSUWP/PixivFSUWP.csproj b/PixivFSUWP/PixivFSUWP.csproj index a8e1a94..e436315 100644 --- a/PixivFSUWP/PixivFSUWP.csproj +++ b/PixivFSUWP/PixivFSUWP.csproj @@ -194,8 +194,8 @@ SearchPage.xaml - - SettingsPage.xaml + + SettingsDialog.xaml UserDetailPage.xaml @@ -280,7 +280,7 @@ Designer MSBuild:Compile - + Designer MSBuild:Compile diff --git a/PixivFSUWP/SearchPage.xaml.cs b/PixivFSUWP/SearchPage.xaml.cs index cf9b97a..76a5f2d 100644 --- a/PixivFSUWP/SearchPage.xaml.cs +++ b/PixivFSUWP/SearchPage.xaml.cs @@ -226,25 +226,25 @@ private async void btnSauceNAO_Click(object sender, RoutedEventArgs e) //读取设置项 if (localSettings.Values["SauceNAOAPI"] as string == null) { - Frame.Navigate(typeof(SettingsPage),null, App.FromRightTransitionInfo); + Frame.Navigate(typeof(SettingsDialog),null, App.FromRightTransitionInfo); SAUCENAO_API_KEY = sauceNAOAPI; return; } else if ((localSettings.Values["SauceNAOAPI"] as string).Length == 0) { - Frame.Navigate(typeof(SettingsPage), null, App.FromRightTransitionInfo); + Frame.Navigate(typeof(SettingsDialog), null, App.FromRightTransitionInfo); SAUCENAO_API_KEY = sauceNAOAPI; return; } if (localSettings.Values["ImgurAPI"] as string == null) { - Frame.Navigate(typeof(SettingsPage), null, App.FromRightTransitionInfo); + Frame.Navigate(typeof(SettingsDialog), null, App.FromRightTransitionInfo); IMGUR_API_KEY = imgurAPI; return; } else if ((localSettings.Values["ImgurAPI"] as string).Length == 0) { - Frame.Navigate(typeof(SettingsPage), null, App.FromRightTransitionInfo); + Frame.Navigate(typeof(SettingsDialog), null, App.FromRightTransitionInfo); IMGUR_API_KEY = imgurAPI; return; } diff --git a/PixivFSUWP/SettingsPage.xaml b/PixivFSUWP/SettingsDialog.xaml similarity index 73% rename from PixivFSUWP/SettingsPage.xaml rename to PixivFSUWP/SettingsDialog.xaml index f8ae51a..92b52f9 100644 --- a/PixivFSUWP/SettingsPage.xaml +++ b/PixivFSUWP/SettingsDialog.xaml @@ -1,5 +1,5 @@ - - - + + + - + @@ -32,12 +37,12 @@ - + - - + + - + @@ -83,25 +88,32 @@ - + - - - + + + - - - + - - + + + + + - + diff --git a/PixivFSUWP/SettingsPage.xaml.cs b/PixivFSUWP/SettingsDialog.xaml.cs similarity index 89% rename from PixivFSUWP/SettingsPage.xaml.cs rename to PixivFSUWP/SettingsDialog.xaml.cs index fcf5d75..27e0310 100644 --- a/PixivFSUWP/SettingsPage.xaml.cs +++ b/PixivFSUWP/SettingsDialog.xaml.cs @@ -19,36 +19,38 @@ namespace PixivFSUWP /// /// 可用于自身或导航至 Frame 内部的空白页。 /// - public sealed partial class SettingsPage : Page, IGoBackFlag + public sealed partial class SettingsDialog { - public SettingsPage() + public SettingsDialog() { this.InitializeComponent(); _ = loadContentsAsync(); + Title = GetResourceString("SettingsPagePlain"); + PrimaryButtonText = GetResourceString("OKPlain"); } - private bool _backflag { get; set; } = false; - - public void SetBackFlag(bool value) - { - _backflag = value; - } - - protected override void OnNavigatedTo(NavigationEventArgs e) - { - base.OnNavigatedTo(e); - TheMainPage?.SelectNavPlaceholder(GetResourceString("SettingsPagePlain")); - } - - protected override void OnNavigatedFrom(NavigationEventArgs e) - { - base.OnNavigatedFrom(e); - if (!_backflag) - { - Data.Backstack.Default.Push(typeof(SettingsPage), null); - TheMainPage?.UpdateNavButtonState(); - } - } + //private bool _backflag { get; set; } = false; + + //public void SetBackFlag(bool value) + //{ + // _backflag = value; + //} + + //protected override void OnNavigatedTo(NavigationEventArgs e) + //{ + // base.OnNavigatedTo(e); + // TheMainPage?.SelectNavPlaceholder(GetResourceString("SettingsPagePlain")); + //} + + //protected override void OnNavigatedFrom(NavigationEventArgs e) + //{ + // base.OnNavigatedFrom(e); + // if (!_backflag) + // { + // Data.Backstack.Default.Push(typeof(SettingsPage), null); + // TheMainPage?.UpdateNavButtonState(); + // } + //} async Task loadContentsAsync() {