From be495da384854d31089d17bead019a9f52c95eb5 Mon Sep 17 00:00:00 2001 From: tobiichiamane Date: Sun, 2 Feb 2020 16:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=97=AE=E9=A2=98=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PixivFSUWP/App.xaml.cs | 2 +- PixivFSUWP/MainPage.xaml.cs | 5 +++-- PixivFSUWP/ReportIssuePage.xaml | 7 +++---- PixivFSUWP/ReportIssuePage.xaml.cs | 28 +++++++++++++--------------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/PixivFSUWP/App.xaml.cs b/PixivFSUWP/App.xaml.cs index 5d64d6b..9fd8067 100644 --- a/PixivFSUWP/App.xaml.cs +++ b/PixivFSUWP/App.xaml.cs @@ -89,7 +89,7 @@ protected override void OnActivated(IActivatedEventArgs args) /// 将在启动应用程序以打开特定文件等情况下使用。 /// /// 有关启动请求和过程的详细信息。 - protected override async void OnLaunched(LaunchActivatedEventArgs e) + protected override void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; diff --git a/PixivFSUWP/MainPage.xaml.cs b/PixivFSUWP/MainPage.xaml.cs index 7a840f6..dff2064 100644 --- a/PixivFSUWP/MainPage.xaml.cs +++ b/PixivFSUWP/MainPage.xaml.cs @@ -234,9 +234,10 @@ private void NavControl_BackRequested(NavigationView sender, NavigationViewBackR } } - private void btnReport_Click(object sender, RoutedEventArgs e) + private async void btnReport_Click(object sender, RoutedEventArgs e) { - + //在新窗口中打开发送反馈的窗口 + await ShowNewWindow(typeof(ReportIssuePage), null); } } } diff --git a/PixivFSUWP/ReportIssuePage.xaml b/PixivFSUWP/ReportIssuePage.xaml index d111ee2..4b2c498 100644 --- a/PixivFSUWP/ReportIssuePage.xaml +++ b/PixivFSUWP/ReportIssuePage.xaml @@ -17,8 +17,8 @@ Report an issue/报告问题 - We've detected a crash in your last session. We've collected some details. - 我们在您的上次会话中探测到一次崩溃,我们收集了一些细节。 + You are going to report an issue. We've collected some details. + 您正准备汇报一个问题,我们收集了一些细节。 @@ -29,8 +29,7 @@ Don't worry. The information you just copied does not contain any private data. 不要担心,您刚刚所复制的信息不会携带您的任何隐私数据。 - - + diff --git a/PixivFSUWP/ReportIssuePage.xaml.cs b/PixivFSUWP/ReportIssuePage.xaml.cs index fff68d3..616309c 100644 --- a/PixivFSUWP/ReportIssuePage.xaml.cs +++ b/PixivFSUWP/ReportIssuePage.xaml.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.ApplicationModel; +using Windows.ApplicationModel.Core; using Windows.ApplicationModel.DataTransfer; using Windows.Foundation; using Windows.Foundation.Collections; @@ -31,15 +32,9 @@ public sealed partial class ReportIssuePage : Page public ReportIssuePage() { this.InitializeComponent(); - Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; - if (localSettings.Values["exception"] == null) - { - Frame.Navigate(typeof(LoginPage)); - return; - } - var lastExeption = (string)localSettings.Values["exception"]; + CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var view = ApplicationView.GetForCurrentView(); - view.Title = "Crash Report/崩溃报告"; + view.Title = "Report an issue/问题反馈"; txtDetails.Text += "General:\n"; txtDetails.Text += string.Format("OS version: build {0}\n", SystemInformation.OperatingSystemVersion.Build); txtDetails.Text += string.Format("App version: {0}.{1}.{2} {3}\n", @@ -48,13 +43,16 @@ public ReportIssuePage() Package.Current.Id.Version.Build, Package.Current.Id.Architecture); txtDetails.Text += string.Format("Package ID: {0}\n\n", Package.Current.Id.Name); - txtDetails.Text += "Exception:\n"; - txtDetails.Text += lastExeption; - } - - private void BtnContinue_Click(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(LoginPage)); + Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; + if (localSettings.Values["isCrashed"] != null && + (bool)localSettings.Values["isCrashed"] == true && + localSettings.Values["exception"] != null) + { + localSettings.Values.Remove("isCrashed"); + var lastExeption = (string)localSettings.Values["exception"]; + txtDetails.Text += "Exception:\n"; + txtDetails.Text += lastExeption; + } } private async void BtnCopy_Click(object sender, RoutedEventArgs e)