Refactored core
UI navigation framework Related Work Items: #408, #414, #416
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user