@@ -38,7 +38,7 @@
|
||||
<Hyperlink Click="Hyperlink_Click">Log in</Hyperlink> to manage your subscriptions
|
||||
</TextBlock>
|
||||
|
||||
<Grid Visibility="Visible" Grid.Column="2" VerticalAlignment="Bottom" Margin="10" Name="subscriptionPane" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Grid Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Bottom" Margin="10" Name="subscriptionPane" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<Button Click="subscribe_Click" Name="subscribe" Width="250" Height="50" Background="Red" Foreground="White" FontSize="18" FontWeight="SemiBold" Content="Subscirbe"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace FoxTube.Pages
|
||||
|
||||
public ChannelPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
InitializeComponent();
|
||||
loading = grid.Children[2] as LoadingPage;
|
||||
playlistLoading = playlists.Children[1] as LoadingPage;
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace FoxTube.Pages
|
||||
loading.Refresh();
|
||||
playlistLoading.Refresh();
|
||||
|
||||
try
|
||||
//try
|
||||
{
|
||||
channelId = id;
|
||||
if (Methods.NeedToResponse)
|
||||
@@ -136,32 +136,25 @@ namespace FoxTube.Pages
|
||||
|
||||
if (SecretsVault.IsAuthorized)
|
||||
{
|
||||
bool b = false;
|
||||
foreach (Subscription s in SecretsVault.Subscriptions)
|
||||
if (SecretsVault.Subscriptions.Any(i => i.Snippet.ResourceId.ChannelId == channelId))
|
||||
{
|
||||
if (s.Snippet.ResourceId.ChannelId == item.Id)
|
||||
{
|
||||
Debug.WriteLine($"{s.Snippet.ResourceId.ChannelId} ({item.Snippet.Title}: {item.Id})");
|
||||
subscribe.Background = new SolidColorBrush(Colors.Transparent);
|
||||
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
|
||||
subscribe.Content = "Subscribed";
|
||||
b = true;
|
||||
break;
|
||||
}
|
||||
subscribe.Background = new SolidColorBrush(Colors.Transparent);
|
||||
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
|
||||
subscribe.Content = "Subscribed";
|
||||
}
|
||||
subscriptionPane.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
loading.Close();
|
||||
}
|
||||
catch (System.Net.Http.HttpRequestException)
|
||||
/*catch (System.Net.Http.HttpRequestException)
|
||||
{
|
||||
loading.Error("System.Net.Http.HttpRequestException", "Unable to connect to Google servers.", true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
loading.Error(e.GetType().ToString(), e.Message);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
async void LoadPlaylist()
|
||||
@@ -290,7 +283,7 @@ namespace FoxTube.Pages
|
||||
|
||||
private void refresh_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Initialize(channelId);
|
||||
Methods.MainPage.GoToChannel(channelId);
|
||||
}
|
||||
|
||||
private async void inBrowser_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -335,11 +335,10 @@ namespace FoxTube
|
||||
return;
|
||||
|
||||
videoPlaceholder.Content = null;
|
||||
MaximizeVideo();
|
||||
Fullscreen(false);
|
||||
|
||||
videoPlaceholder.Navigate(typeof(VideoPage), new string[2] { id, playlistId });
|
||||
nav.Header = "Video";
|
||||
MaximizeVideo();
|
||||
}
|
||||
|
||||
public void GoToDeveloper(string id)
|
||||
@@ -402,6 +401,15 @@ namespace FoxTube
|
||||
{ typeof(Downloads), () => nav.Header = "Downloads" }
|
||||
};
|
||||
|
||||
if (content.SourcePageType == typeof(Home) || content.SourcePageType == typeof(Settings) || content.SourcePageType == typeof(Subscriptions))
|
||||
{
|
||||
nav.ExpandedModeThresholdWidth = 1008;
|
||||
if (nav.DisplayMode == NavigationViewDisplayMode.Expanded)
|
||||
nav.IsPaneOpen = true;
|
||||
}
|
||||
else
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
|
||||
try { switchCase[content.SourcePageType](); }
|
||||
catch { }
|
||||
}
|
||||
@@ -417,7 +425,11 @@ namespace FoxTube
|
||||
nav.IsBackEnabled = true;
|
||||
|
||||
if (videoPlaceholder.Content != null)
|
||||
{
|
||||
nav.Header = "Video";
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
nav.IsPaneOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Fullscreen(bool on)
|
||||
@@ -531,7 +543,6 @@ namespace FoxTube
|
||||
|
||||
public void content_Navigated(object sender, NavigationEventArgs e)
|
||||
{
|
||||
Debug.WriteLine($"Navigated to {e.SourcePageType}");
|
||||
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
|
||||
{
|
||||
{ typeof(Settings), () => nav.Header = "Settings" },
|
||||
@@ -682,7 +693,7 @@ namespace FoxTube
|
||||
nav.IsPaneOpen = true;
|
||||
}
|
||||
else
|
||||
nav.ExpandedModeThresholdWidth = int.MaxValue;
|
||||
nav.ExpandedModeThresholdWidth = short.MaxValue;
|
||||
|
||||
if (videoPlaceholder.Content != null && videoPlaceholder.HorizontalAlignment == HorizontalAlignment.Stretch)
|
||||
MinimizeAsInitializer();
|
||||
|
||||
Reference in New Issue
Block a user