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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FoxTube/Views/Search.xaml.cs b/FoxTube/Views/Search.xaml.cs
new file mode 100644
index 0000000..f6eeec5
--- /dev/null
+++ b/FoxTube/Views/Search.xaml.cs
@@ -0,0 +1,60 @@
+using FoxTube.Core.Models;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace FoxTube.Views
+{
+ ///
+ /// Search results page
+ ///
+ public sealed partial class Search : PageView, IRefreshable
+ {
+ bool closingByToggle = false;
+
+ public Search() =>
+ InitializeComponent();
+
+ public void RefreshPage()
+ {
+ throw new NotImplementedException();
+ }
+
+ void ToggleFilters_Click(object sender, RoutedEventArgs e)
+ {
+ if(filters.Visibility == Visibility.Visible)
+ {
+ filters.Visibility = Visibility.Collapsed;
+ (sender as HyperlinkButton).Content = "Show filters \xE71C";
+ }
+ else
+ {
+ filters.Visibility = Visibility.Visible;
+ (sender as HyperlinkButton).Content = "Hide filters \xE71C";
+ }
+ }
+
+ private void MenuFlyout_Closing(FlyoutBase sender, FlyoutBaseClosingEventArgs args)
+ {
+ if(closingByToggle)
+ {
+ args.Cancel = true;
+ closingByToggle = false;
+ }
+ }
+
+ void ToggleMenuFlyoutItem_Click(object sender, RoutedEventArgs e) =>
+ closingByToggle = true;
+ }
+}
diff --git a/FoxTube/Views/Settings.xaml b/FoxTube/Views/Settings.xaml
index fabaece..fffc9bd 100644
--- a/FoxTube/Views/Settings.xaml
+++ b/FoxTube/Views/Settings.xaml
@@ -16,7 +16,7 @@
-
+
diff --git a/FoxTube/Views/SettingsSections/About.xaml b/FoxTube/Views/SettingsSections/About.xaml
index 0df5c6b..869396c 100644
--- a/FoxTube/Views/SettingsSections/About.xaml
+++ b/FoxTube/Views/SettingsSections/About.xaml
@@ -17,6 +17,12 @@
+
+
+
+
+
+
diff --git a/FoxTube/Views/SettingsSections/General.xaml b/FoxTube/Views/SettingsSections/General.xaml
index 7a8342e..da4ae18 100644
--- a/FoxTube/Views/SettingsSections/General.xaml
+++ b/FoxTube/Views/SettingsSections/General.xaml
@@ -7,14 +7,13 @@
mc:Ignorable="d">
-
-
+
+
+
+
+
+
-
-
-
-
-
diff --git a/FoxTube/Views/Subscriptions.xaml b/FoxTube/Views/Subscriptions.xaml
new file mode 100644
index 0000000..533b4f4
--- /dev/null
+++ b/FoxTube/Views/Subscriptions.xaml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/FoxTube/Views/Subscriptions.xaml.cs b/FoxTube/Views/Subscriptions.xaml.cs
new file mode 100644
index 0000000..c0c2b90
--- /dev/null
+++ b/FoxTube/Views/Subscriptions.xaml.cs
@@ -0,0 +1,27 @@
+using FoxTube.Core.Models;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+namespace FoxTube.Views
+{
+ ///
+ /// User's subscriptions list
+ ///
+ public sealed partial class Subscriptions : PageView
+ {
+ public Subscriptions() =>
+ InitializeComponent();
+ }
+}