Archived
1
0

Refactored core

UI navigation framework

Related Work Items: #408, #414, #416
This commit is contained in:
Michael Gordeev
2020-06-15 15:46:38 +03:00
parent c58d846057
commit 787a6e9f48
72 changed files with 2002 additions and 1227 deletions
+28 -1
View File
@@ -2,6 +2,8 @@
using System;
using Windows.ApplicationModel.Core;
using Windows.Security.Credentials;
using Windows.UI;
using Windows.UI.ViewManagement;
namespace FoxTube.Utils
{
@@ -29,11 +31,36 @@ namespace FoxTube.Utils
public static async void InitializeFailsafeProtocol()
{
Metrics.AddEvent("Failsafe protocol initiated");
await Storage.ResetStorage();
await StorageService.ClearStorage();
PasswordVault passwordVault = new PasswordVault();
foreach (PasswordCredential credential in passwordVault.RetrieveAll())
passwordVault.Remove(credential);
RestartApp();
}
public static void UpdateTitleBarTheme(bool isDark)
{
ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
titleBar.ButtonBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
titleBar.ButtonInactiveForegroundColor = Colors.Gray;
if (isDark)
{
titleBar.ButtonForegroundColor =
titleBar.ButtonHoverForegroundColor =
titleBar.ButtonPressedForegroundColor = Colors.White;
titleBar.ButtonHoverBackgroundColor = Color.FromArgb(50, 255, 255, 255);
titleBar.ButtonPressedBackgroundColor = Color.FromArgb(30, 255, 255, 255);
}
else
{
titleBar.ButtonForegroundColor =
titleBar.ButtonHoverForegroundColor =
titleBar.ButtonPressedForegroundColor = Colors.Black;
titleBar.ButtonHoverBackgroundColor = Color.FromArgb(50, 0, 0, 0);
titleBar.ButtonPressedBackgroundColor = Color.FromArgb(70, 0, 0, 0);
}
}
}
}