diff --git a/FoxTube.Core/Models/PageView.cs b/FoxTube.Core/Models/PageView.cs index a48d696..3d6c96f 100644 --- a/FoxTube.Core/Models/PageView.cs +++ b/FoxTube.Core/Models/PageView.cs @@ -5,7 +5,16 @@ namespace FoxTube.Core.Models { public class PageView : Page { - public string Header { get; set; } + public string Header + { + get => _header; + set + { + _header = value; + UpdateTitle(); + } + } + string _header; public object Parameter { get; private set; } protected override void OnNavigatedTo(NavigationEventArgs e) @@ -13,5 +22,7 @@ namespace FoxTube.Core.Models base.OnNavigatedTo(e); Parameter = e.Parameter; } + + public virtual void UpdateTitle() { } } } diff --git a/FoxTube/Controls/Cards/VideoCard.xaml b/FoxTube/Controls/Cards/VideoCard.xaml index 1c71fd6..d1e04e0 100644 --- a/FoxTube/Controls/Cards/VideoCard.xaml +++ b/FoxTube/Controls/Cards/VideoCard.xaml @@ -13,84 +13,78 @@ Margin="3" SizeChanged="UserControl_SizeChanged"> - - - + + + + + diff --git a/FoxTube/FoxTube.csproj b/FoxTube/FoxTube.csproj index 79285b0..d0eb8d4 100644 --- a/FoxTube/FoxTube.csproj +++ b/FoxTube/FoxTube.csproj @@ -130,6 +130,9 @@ Home.xaml + + Search.xaml + Settings.xaml @@ -145,6 +148,9 @@ Translate.xaml + + Subscriptions.xaml + @@ -246,6 +252,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -266,6 +276,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + diff --git a/FoxTube/MainPage.xaml.cs b/FoxTube/MainPage.xaml.cs index a60b7fc..ef73388 100644 --- a/FoxTube/MainPage.xaml.cs +++ b/FoxTube/MainPage.xaml.cs @@ -127,6 +127,9 @@ namespace FoxTube Current.content.Navigate(pageType, param); } + public static void SetHeader(string title) => + Current.title.Text = title; + void Content_Navigated(object sender, NavigationEventArgs e) { refresh.Visibility = (e.Content is IRefreshable) ? Visibility.Visible : Visibility.Collapsed; @@ -140,6 +143,9 @@ namespace FoxTube case "Settings": NavigationViewControl.SelectedItem = NavigationViewControl.SettingsItem; break; + case "Subscriptions": + NavigationViewControl.SelectedItem = subscriptions; + break; default: NavigationViewControl.SelectedItem = null; break; @@ -177,7 +183,10 @@ namespace FoxTube void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { + if (args.QueryText.Length < 3) + return; // TODO: Go to search + Navigate(typeof(Views.Search)); } void NavigationViewControl_BackRequested(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewBackRequestedEventArgs args) @@ -198,6 +207,7 @@ namespace FoxTube Navigate(typeof(Views.Home)); break; case "subscriptions": + Navigate(typeof(Views.Subscriptions)); break; case "history": break; diff --git a/FoxTube/Views/Home.xaml.cs b/FoxTube/Views/Home.xaml.cs index c7b4489..55f31ff 100644 --- a/FoxTube/Views/Home.xaml.cs +++ b/FoxTube/Views/Home.xaml.cs @@ -23,6 +23,9 @@ namespace FoxTube.Views { base.OnNavigatedTo(e); + if (e.NavigationMode != NavigationMode.New) + return; + for (int i = 0; i < 25; i++) { recommendedItems.Add(new VideoCard()); diff --git a/FoxTube/Views/Search.xaml b/FoxTube/Views/Search.xaml new file mode 100644 index 0000000..709efbb --- /dev/null +++ b/FoxTube/Views/Search.xaml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +