diff --git a/FoxTube/Channel.xaml b/FoxTube/Channel.xaml
index 4372898..ef5c85d 100644
--- a/FoxTube/Channel.xaml
+++ b/FoxTube/Channel.xaml
@@ -19,7 +19,7 @@
-
+
-
-
+
-
-
+
diff --git a/FoxTube/General.xaml b/FoxTube/General.xaml
index f7bd8b9..dddae99 100644
--- a/FoxTube/General.xaml
+++ b/FoxTube/General.xaml
@@ -10,9 +10,8 @@
-
-
-
+
+
@@ -23,18 +22,21 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FoxTube/General.xaml.cs b/FoxTube/General.xaml.cs
index 7c5b9dc..096082f 100644
--- a/FoxTube/General.xaml.cs
+++ b/FoxTube/General.xaml.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
+using Windows.Storage;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
@@ -22,9 +23,56 @@ namespace FoxTube
///
public sealed partial class General : Page
{
+ ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
public General()
{
this.InitializeComponent();
+ language.SelectedIndex = (int)settings.Values["language"];
+ quality.SelectedIndex = (int)settings.Values["quality"];
+
+ newVideo.IsChecked = (bool)settings.Values["newVideoNotification"];
+ newComment.IsChecked = (bool)settings.Values["newCommentNotification"];
+ newPost.IsChecked = (bool)settings.Values["newPostNotification"];
+ messages.IsChecked = (bool)settings.Values["newmessagesNotification"];
+
+ mobileWarning.IsOn = (bool)settings.Values["moblieWarning"];
+ autoplay.IsOn = (bool)settings.Values["videoAutoplay"];
+ }
+
+ private void language_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if((int)settings.Values["language"] != language.SelectedIndex)
+ {
+ settings.Values["language"] = language.SelectedIndex;
+ restartNote.Visibility = Visibility.Visible;
+ }
+ }
+
+ private void quality_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ if ((int)settings.Values["quality"] != quality.SelectedIndex)
+ settings.Values["quality"] = quality.SelectedIndex;
+ }
+
+ private void notification_IsEnabledChanged(object sender, RoutedEventArgs e)
+ {
+ if ((bool)settings.Values["newVideoNotification"] != newVideo.IsChecked)
+ settings.Values["newVideoNotification"] = newVideo.IsChecked;
+
+ if ((bool)settings.Values["newPostNotification"] != newPost.IsChecked)
+ settings.Values["newPostNotification"] = newPost.IsChecked;
+
+ if ((bool)settings.Values["newCommentNotification"] != newComment.IsChecked)
+ settings.Values["newCommentNotification"] = newComment.IsChecked;
+
+ if ((bool)settings.Values["newmessagesNotification"] != messages.IsChecked)
+ settings.Values["newmessagesNotification"] = messages.IsChecked;
+
+ if ((bool)settings.Values["moblieWarning"] != mobileWarning.IsOn)
+ settings.Values["moblieWarning"] = mobileWarning.IsOn;
+
+ if ((bool)settings.Values["videoAutoplay"] != autoplay.IsOn)
+ settings.Values["videoAutoplay"] = autoplay.IsOn;
}
}
}
diff --git a/FoxTube/MainPage.xaml b/FoxTube/MainPage.xaml
index 52d49f4..5b220a2 100644
--- a/FoxTube/MainPage.xaml
+++ b/FoxTube/MainPage.xaml
@@ -72,7 +72,10 @@
-
+
+
@@ -102,7 +105,7 @@
-
+
-
+
-
+
-
+
@@ -198,9 +201,9 @@
-
+
-
+
@@ -213,7 +216,7 @@
-
+
diff --git a/FoxTube/MainPage.xaml.cs b/FoxTube/MainPage.xaml.cs
index 0663064..3ef8061 100644
--- a/FoxTube/MainPage.xaml.cs
+++ b/FoxTube/MainPage.xaml.cs
@@ -18,6 +18,7 @@ using System.Diagnostics;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.UI.Notifications;
using Windows.UI.Xaml.Media.Imaging;
+using Windows.Storage;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
@@ -28,10 +29,24 @@ namespace FoxTube
///
public sealed partial class MainPage : Page
{
+ ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
List notifications = new List();
public MainPage()
{
this.InitializeComponent();
+ if(settings.Values["language"] == null)
+ {
+ settings.Values.Add("language", 0);
+ settings.Values.Add("quality", 0);
+
+ settings.Values.Add("newVideoNotification", true);
+ settings.Values.Add("newCommentNotification", true);
+ settings.Values.Add("newPostNotification", true);
+ settings.Values.Add("newmessagesNotification", true);
+
+ settings.Values.Add("moblieWarning", false);
+ settings.Values.Add("videoAutoplay", true);
+ }
content.Navigate(typeof(Home));
}
@@ -204,11 +219,12 @@ namespace FoxTube
}
else if (bottomHaburger.SelectedIndex == 2)
{
- switch(content.SourcePageType)
- {
-
- }
- topHamburger.SelectedIndex = 0;
+ if(content.SourcePageType == typeof(Settings))
+ bottomHaburger.SelectedIndex = 3;
+ else if (content.SourcePageType == typeof(Home))
+ topHamburger.SelectedIndex = 0;
+ else if (content.SourcePageType == typeof(Channel))
+ bottomHaburger.SelectedIndex = 1;
}
}
@@ -263,5 +279,10 @@ namespace FoxTube
subsLogErr.Visibility = Visibility.Visible;
} catch { }
}
+
+ private void LoggedAvatar_Click(object sender, RoutedEventArgs e)
+ {
+ AccountManagement.IsOpen = true;
+ }
}
}