diff --git a/FoxTube/Classes/SettingsStorage.cs b/FoxTube/Classes/SettingsStorage.cs index d2a42ef..fa5437b 100644 --- a/FoxTube/Classes/SettingsStorage.cs +++ b/FoxTube/Classes/SettingsStorage.cs @@ -67,7 +67,7 @@ namespace FoxTube } public static int Volume { - get { return (int)settings[6]; } + get { return Convert.ToInt32(settings[6]); } set { settings[6] = value; @@ -95,7 +95,7 @@ namespace FoxTube } public static int SafeSearch { - get { return (int)settings[9]; } + get { return Convert.ToInt32(settings[9]); } set { settings[9] = value; @@ -105,7 +105,7 @@ namespace FoxTube public static int Theme { - get { return (int)settings[10]; } + get { return Convert.ToInt32(settings[10]); } set { settings[10] = value; diff --git a/FoxTube/Pages/MainPage.xaml.cs b/FoxTube/Pages/MainPage.xaml.cs index 6b0121d..4ddebb0 100644 --- a/FoxTube/Pages/MainPage.xaml.cs +++ b/FoxTube/Pages/MainPage.xaml.cs @@ -21,6 +21,8 @@ using System.Net; using Windows.UI.Popups; using Windows.Networking.Connectivity; using Windows.UI.Core; +using System.Threading; +using System.Threading.Tasks; namespace FoxTube { @@ -67,6 +69,12 @@ namespace FoxTube SetTitleBar(); } + protected override void OnNavigatedTo(NavigationEventArgs e) + { + base.OnNavigatedTo(e); + content.Navigate(typeof(Home)); + } + public Video GetCurrentItem() { try { return (videoPlaceholder.Content as VideoPage).item; } @@ -234,11 +242,11 @@ namespace FoxTube await dialog.ShowAsync(); } - - content.Navigate(typeof(Home)); if (videoPlaceholder.Content != null) GoToVideo((videoPlaceholder.Content as VideoPage).videoId); + + nav.SelectedItem = toHome; } private async void feedback_Click(object sender, TappedRoutedEventArgs e) @@ -487,6 +495,7 @@ namespace FoxTube private void nav_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { + Debug.WriteLine("Menu selection changed"); try { if (s == Sender.None) @@ -522,6 +531,7 @@ namespace FoxTube public void content_Navigated(object sender, NavigationEventArgs e) { + Debug.WriteLine($"Navigated to {e.SourcePageType}"); Dictionary switchCase = new Dictionary() { { typeof(Settings), () => nav.Header = "Settings" },