Archived
1
0

Notification system development 1

This commit is contained in:
Michael Gordeev
2018-10-24 21:23:48 +03:00
parent f545edc6c1
commit 1a93ea4801
2 changed files with 25 additions and 3 deletions
+23 -2
View File
@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -72,8 +73,6 @@ namespace FoxTube
/// <param name="e">Details about the launch request and process.</param> /// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e) protected override void OnLaunched(LaunchActivatedEventArgs e)
{ {
SecretsVault.CheckAuthorization();
Frame rootFrame = Window.Current.Content as Frame; Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content, // Do not repeat app initialization when the Window already has content,
@@ -110,6 +109,28 @@ namespace FoxTube
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
} }
protected override void OnActivated(IActivatedEventArgs e)
{
base.OnActivated(e);
if (e is ToastNotificationActivatedEventArgs)
{
string[] args = (e as ToastNotificationActivatedEventArgs).Argument.Split('|');
switch (args[0])
{
case "changelog":
case "inbox":
Methods.MainPage.GoToDeveloper(args[1]);
break;
//TODO: The rest
}
}
CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
Window.Current.Activate();
}
/// <summary> /// <summary>
/// Invoked when Navigation to a certain page fails /// Invoked when Navigation to a certain page fails
/// </summary> /// </summary>
+2 -1
View File
@@ -74,7 +74,7 @@ namespace FoxTube
if (settings.Values["ver"] == null) if (settings.Values["ver"] == null)
settings.Values.Add("ver", $"{ver.Major}.{ver.Minor}"); settings.Values.Add("ver", $"{ver.Major}.{ver.Minor}");
if((string)settings.Values["ver"] != $"{ver.Major}.{ver.Minor}") //Replace for '!=' !!! if((string)settings.Values["ver"] == $"{ver.Major}.{ver.Minor}") //Replace for '!=' !!!
{ {
try try
{ {
@@ -91,6 +91,7 @@ namespace FoxTube
SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged; SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged;
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged; SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
SecretsVault.CheckAuthorization();
SetTitleBar(); SetTitleBar();
} }