diff --git a/FoxTube/Controls/NotificationsCenter.xaml b/FoxTube/Controls/NotificationsCenter.xaml
deleted file mode 100644
index d8261ed..0000000
--- a/FoxTube/Controls/NotificationsCenter.xaml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/FoxTube/Controls/NotificationsCenter.xaml.cs b/FoxTube/Controls/NotificationsCenter.xaml.cs
deleted file mode 100644
index aa9d015..0000000
--- a/FoxTube/Controls/NotificationsCenter.xaml.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using FoxTube.Background;
-using Microsoft.Toolkit.Uwp.Notifications;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Xml;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.Storage;
-using Windows.UI;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
-
-// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
-
-namespace FoxTube
-{
- public sealed partial class NotificationsCenter : UserControl
- {
- List notifications = new List();
-
- private ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
- XmlDocument doc = new XmlDocument();
- public NotificationsCenter()
- {
- this.InitializeComponent();
- }
-
- public void Initialize()
- {
- try
- {
- doc.LoadXml(settings.Values["notificationsHistory"] as string);
- foreach (XmlElement n in doc["history"].ChildNodes)
- AddNotification(new Notification(n.ToString()));
- }
- catch { }
-
- BackgroundProcessor.NotificationRecieved += NewNotification;
- }
-
- private void NewNotification(object sender, Notification item)
- {
- AddNotification(item);
- }
-
- private void clear_Click(object sender, RoutedEventArgs e)
- {
- array.Children.Clear();
- notifications.Clear();
- doc["history"].InnerXml = "";
- settings.Values["notificationsHistory"] = doc.InnerXml;
- clear.Visibility = Visibility.Collapsed;
- noNotifications.Visibility = Visibility.Visible;
- }
-
- public void AddNotification(Notification notification)
- {
- notifications.Add(notification);
- Methods.MainPage.GotNotification();
- noNotifications.Visibility = Visibility.Collapsed;
- clear.Visibility = Visibility.Visible;
-
- Button item = notification.GetNotification();
- item.Click += Notification_Click;
-
- array.Children.Add(item);
- }
-
- private void Notification_Click(object sender, RoutedEventArgs e)
- {
- Notification n = notifications[array.Children.IndexOf(sender as Button)];
- switch(n.Type)
- {
- case NotificationType.Changelog:
- case NotificationType.Internal:
- Methods.MainPage.GoToDeveloper(n.Id);
- break;
- case NotificationType.Video:
- Methods.MainPage.GoToVideo(n.Id);
- break;
- }
- }
- }
-}
diff --git a/FoxTube/FoxTube.csproj b/FoxTube/FoxTube.csproj
index 9961956..67b00cd 100644
--- a/FoxTube/FoxTube.csproj
+++ b/FoxTube/FoxTube.csproj
@@ -153,9 +153,6 @@
MainPage.xaml
-
- NotificationsCenter.xaml
-
PlaylistCardWide.xaml
@@ -348,10 +345,6 @@
MSBuild:Compile
Designer
-
- Designer
- MSBuild:Compile
-
Designer
MSBuild:Compile
diff --git a/FoxTube/Pages/MainPage.xaml b/FoxTube/Pages/MainPage.xaml
index 2ada653..1d3d188 100644
--- a/FoxTube/Pages/MainPage.xaml
+++ b/FoxTube/Pages/MainPage.xaml
@@ -14,24 +14,7 @@
PreviewKeyUp="Page_PreviewKeyUp">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -63,6 +46,33 @@
+
+
@@ -70,47 +80,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/FoxTube/Pages/MainPage.xaml.cs b/FoxTube/Pages/MainPage.xaml.cs
index c65796a..1717536 100644
--- a/FoxTube/Pages/MainPage.xaml.cs
+++ b/FoxTube/Pages/MainPage.xaml.cs
@@ -40,8 +40,7 @@ namespace FoxTube
public DownloadAgent Agent = new DownloadAgent();
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
-
- NotificationsCenter notificationsCenter = new NotificationsCenter();
+
Sender s = Sender.None;
public MainPage()
{
@@ -111,7 +110,6 @@ namespace FoxTube
}
catch { }
}
- notificationsCenter.Initialize();
SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged;
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
@@ -191,8 +189,8 @@ namespace FoxTube
{
Userinfoplus info = await new Oauth2Service(SecretsVault.Initializer).Userinfo.Get().ExecuteAsync();
- ToolTipService.SetToolTip(avatar, new ToolTip() { Content = info.Name });
- (avatar.Content as PersonPicture).ProfilePicture = new BitmapImage(new Uri(info.Picture));
+ myName.Text = info.Name;
+ ((avatar.Content as StackPanel).Children[0] as PersonPicture).ProfilePicture = new BitmapImage(new Uri(info.Picture));
}
catch { }
avatar.Visibility = Visibility.Visible;
@@ -256,16 +254,6 @@ namespace FoxTube
GoToVideo((videoPlaceholder.Content as VideoPage).videoId);
}
- public void GotNotification()
- {
- notificationMenu.Content = "\xED0C";
- }
-
- public void notificationMenu_Click(object sender, RoutedEventArgs e)
- {
- notificationMenu.Content = "\xED0D";
- }
-
private async void feedback_Click(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("feedback-hub:"));
@@ -502,14 +490,14 @@ namespace FoxTube
{
Dictionary switchCase = new Dictionary()
{
- { typeof(Settings), () => header.Text = "Settings" },
- { typeof(ChannelPage), () => header.Text = "Channel" },
- { typeof(PlaylistPage), () => header.Text = "Playlist" },
- { typeof(Search), () => header.Text = "Search" },
- { typeof(Subscriptions), () => header.Text = "Subscriptions" },
- { typeof(History), () => header.Text = "History" },
- { typeof(Home), () => header.Text = "Home" },
- { typeof(Downloads), () => header.Text = "Downloads" }
+ { typeof(Settings), () => nav.Header = "Settings" },
+ { typeof(ChannelPage), () => nav.Header = "Channel" },
+ { typeof(PlaylistPage), () => nav.Header = "Playlist" },
+ { typeof(Search), () => nav.Header = "Search" },
+ { typeof(Subscriptions), () => nav.Header = "Subscriptions" },
+ { typeof(History), () => nav.Header = "History" },
+ { typeof(Home), () => nav.Header = "Home" },
+ { typeof(Downloads), () => nav.Header = "Downloads" }
};
try { switchCase[e.SourcePageType](); }