Archived
1
0

Menu opening fixed

Related Work Items: #228
This commit is contained in:
Michael Gordeev
2018-12-23 14:08:13 +03:00
parent 18a4cdafaa
commit e71761c38f
3 changed files with 25 additions and 21 deletions
+1 -1
View File
@@ -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>
+9 -16
View File
@@ -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)
+15 -4
View File
@@ -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();