New toast action to show toast messages from XAML

Code cleanup for Sonar
Tests corrections
This commit is contained in:
BONNEVILLE Geoffroy
2018-06-21 11:13:40 +02:00
parent 803dab0fb5
commit 559fbe65c3
15 changed files with 110 additions and 54 deletions

View File

@@ -114,7 +114,8 @@ namespace ModernKeePass
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously terminated application
// Load state from previously terminated application
await SuspensionManager.RestoreAsync();
#if DEBUG
await MessageDialogHelper.ShowNotificationDialog("App terminated", "Windows or an error made the app terminate");
#endif
@@ -164,7 +165,7 @@ namespace ModernKeePass
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
throw new NavigationException(e.SourcePageType);
}
/// <summary>
@@ -174,7 +175,7 @@ namespace ModernKeePass
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
private async void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
var database = DatabaseService.Instance;
@@ -187,6 +188,7 @@ namespace ModernKeePass
{
ToastNotificationHelper.ShowErrorToast(exception);
}
await SuspensionManager.SaveAsync();
deferral.Complete();
}