-Fixed Unspecified error on App.e.g.cs
-Refactoring
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem x:Uid="/Main/liked" Icon="Like" Content="Liked videos" Name="toLiked" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/later" Icon="Clock" Content="Watch later" Name="toLater" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/downloads" Icon="Download" Content="Downloads" Name="toDownloads" Visibility="Collapsed"/>
|
||||
<NavigationViewItem x:Uid="/Main/downloads" Icon="Download" Content="Downloads" Name="toDownloads"/>
|
||||
<NavigationViewItemHeader x:Uid="/Main/subscriptions" Content="Subscriptions" Name="subsHeader" Visibility="Collapsed"/>
|
||||
</NavigationView.MenuItems>
|
||||
|
||||
|
||||
@@ -39,37 +39,11 @@ namespace FoxTube
|
||||
public enum Sender { Menu, Frame, None }
|
||||
|
||||
public sealed partial class MainPage : Page
|
||||
{
|
||||
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
|
||||
|
||||
{
|
||||
Sender s = Sender.None;
|
||||
public MainPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
if (settings.Values["quality"] == null)
|
||||
settings.Values.Add("quality", "remember");
|
||||
if (settings.Values["rememberedQuality"] == null)
|
||||
settings.Values.Add("rememberedQuality", "1080p");
|
||||
|
||||
if (settings.Values["newVideoNotification"] == null)
|
||||
settings.Values.Add("newVideoNotification", true);
|
||||
if (settings.Values["devNews"] == null)
|
||||
settings.Values.Add("devNews", true);
|
||||
|
||||
if (settings.Values["moblieWarning"] == null)
|
||||
settings.Values.Add("moblieWarning", false);
|
||||
if (settings.Values["videoAutoplay"] == null)
|
||||
settings.Values.Add("videoAutoplay", true);
|
||||
if (settings.Values["themeMode"] == null)
|
||||
settings.Values.Add("themeMode", 2);
|
||||
if (settings.Values["volume"] == null)
|
||||
settings.Values.Add("volume", 100);
|
||||
|
||||
if (settings.Values["region"] == null)
|
||||
settings.Values.Add("region", CultureInfo.CurrentCulture.Name);
|
||||
if (settings.Values["safeSearch"] == null)
|
||||
settings.Values.Add("safeSearch", 0);
|
||||
|
||||
PackageVersion ver = Package.Current.Id.Version;
|
||||
if (settings.Values["ver"] == null)
|
||||
@@ -90,9 +64,7 @@ namespace FoxTube
|
||||
catch { }
|
||||
}
|
||||
|
||||
content.Navigate(typeof(Home));
|
||||
|
||||
SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged;
|
||||
SecretsVault.AuthorizationStateChanged += AuthorizationStateChanged;
|
||||
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
|
||||
SecretsVault.NotPurchased += () => removeAds.Visibility = Visibility.Visible;
|
||||
SecretsVault.CheckAuthorization();
|
||||
@@ -165,7 +137,7 @@ namespace FoxTube
|
||||
nav.MenuItems.RemoveAt((int)args[1] + 9);
|
||||
}
|
||||
|
||||
private async void Vault_AuthorizationStateChanged(object sender, EventArgs e)
|
||||
private async void AuthorizationStateChanged()
|
||||
{
|
||||
if(SecretsVault.IsAuthorized)
|
||||
{
|
||||
@@ -186,7 +158,6 @@ namespace FoxTube
|
||||
toHistory.Visibility = Visibility.Visible;
|
||||
toLiked.Visibility = Visibility.Visible;
|
||||
toLater.Visibility = Visibility.Visible;
|
||||
toDownloads.Visibility = Visibility.Visible;
|
||||
subsHeader.Visibility = Visibility.Visible;
|
||||
|
||||
if (SecretsVault.Subscriptions.Count > 0)
|
||||
@@ -229,15 +200,13 @@ namespace FoxTube
|
||||
toHistory.Visibility = Visibility.Collapsed;
|
||||
toLiked.Visibility = Visibility.Collapsed;
|
||||
toLater.Visibility = Visibility.Collapsed;
|
||||
toDownloads.Visibility = Visibility.Collapsed;
|
||||
subsHeader.Visibility = Visibility.Collapsed;
|
||||
|
||||
subsHeader.Visibility = Visibility.Collapsed;
|
||||
for(int k = 9; k < nav.MenuItems.Count; k++)
|
||||
nav.MenuItems.RemoveAt(k);
|
||||
}
|
||||
|
||||
nav.SelectedItem = toHome;
|
||||
|
||||
content.Navigate(typeof(Home));
|
||||
|
||||
if (videoPlaceholder.Content != null)
|
||||
@@ -261,7 +230,7 @@ namespace FoxTube
|
||||
|
||||
private void myChannel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
content.Navigate(typeof(Channel), SecretsVault.UserChannel.Id);
|
||||
GoToChannel(SecretsVault.AccountId);
|
||||
}
|
||||
|
||||
private void logout_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user