From 73c4bbf360efbc9cb6dbb3439e96328e819ffa77 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Wed, 10 Oct 2018 20:29:32 +0300 Subject: [PATCH] #204: Fixed --- FoxTube/Pages/MainPage.xaml | 5 +- FoxTube/Pages/VideoPage.xaml | 100 ++++++++++++++++---------------- FoxTube/Pages/VideoPage.xaml.cs | 47 ++++++--------- 3 files changed, 69 insertions(+), 83 deletions(-) diff --git a/FoxTube/Pages/MainPage.xaml b/FoxTube/Pages/MainPage.xaml index a2bfef9..2ada653 100644 --- a/FoxTube/Pages/MainPage.xaml +++ b/FoxTube/Pages/MainPage.xaml @@ -24,17 +24,14 @@ - - - - + diff --git a/FoxTube/Pages/VideoPage.xaml b/FoxTube/Pages/VideoPage.xaml index 63ce695..b9949a0 100644 --- a/FoxTube/Pages/VideoPage.xaml +++ b/FoxTube/Pages/VideoPage.xaml @@ -34,67 +34,69 @@ - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + + + diff --git a/FoxTube/Pages/VideoPage.xaml.cs b/FoxTube/Pages/VideoPage.xaml.cs index 30272f6..4995721 100644 --- a/FoxTube/Pages/VideoPage.xaml.cs +++ b/FoxTube/Pages/VideoPage.xaml.cs @@ -92,11 +92,7 @@ namespace FoxTube.Pages { Debug.WriteLine("Correcting layout..."); mainContent.Children.Remove(descriptionPanel); - pivot.Items.Insert(0, new PivotItem() - { - Content = descriptionPanel, - Header = "Description" - }); + pivot.Items.Insert(0, descriptionPanel); tabsPlaceholder.Children.Remove(pivot); mainContent.Children.Add(pivot); @@ -360,39 +356,30 @@ namespace FoxTube.Pages else wide = false; - if (e.NewSize.Width > 1000 && e.PreviousSize.Width <= 1000 && !isExtended) + if (e.NewSize.Width > 1000 && mainContent.Children.Contains(pivot) && !isExtended) { - if (mainContent.Children.Contains(pivot)) - { - mainContent.Children.Remove(pivot); - tabsPlaceholder.Children.Add(pivot); + mainContent.Children.Remove(pivot); + tabsPlaceholder.Children.Add(pivot); + + pivot.Items.RemoveAt(0); + mainContent.Children.Add(descriptionPanel); - (pivot.Items[0] as PivotItem).Content = null; - pivot.Items.RemoveAt(0); - mainContent.Children.Add(descriptionPanel); - } - grid.ColumnDefinitions[1].Width = new GridLength(400); + + pivot.SelectedIndex = 0; } - else if (e.NewSize.Width <= 1000 & e.PreviousSize.Width > 1000) + else if (e.NewSize.Width <= 1000 && mainContent.Children.Contains(descriptionPanel)) { - if (mainContent.Children.Contains(descriptionPanel)) - { - mainContent.Children.Remove(descriptionPanel); - pivot.Items.Insert(0, new PivotItem() - { - Content = descriptionPanel, - Header = "Description" - }); + mainContent.Children.Remove(descriptionPanel); + pivot.Items.Insert(0, descriptionPanel); + + tabsPlaceholder.Children.Remove(pivot); + mainContent.Children.Add(pivot); - tabsPlaceholder.Children.Remove(pivot); - mainContent.Children.Add(pivot); - } - grid.ColumnDefinitions[1].Width = new GridLength(0); - } - pivot.SelectedIndex = 0; + pivot.SelectedIndex = 0; + } } private async void Share(DataTransferManager sender, DataRequestedEventArgs args)