787a6e9f48
UI navigation framework Related Work Items: #408, #414, #416
42 lines
853 B
C#
42 lines
853 B
C#
using Windows.UI.Xaml.Controls;
|
|
using Windows.UI.Xaml.Navigation;
|
|
|
|
namespace FoxTube.Views
|
|
{
|
|
/// <summary>
|
|
/// Settings page
|
|
/// </summary>
|
|
public sealed partial class SettingsView : Page
|
|
{
|
|
public SettingsView() =>
|
|
InitializeComponent();
|
|
|
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
{
|
|
base.OnNavigatedTo(e);
|
|
|
|
if (string.IsNullOrWhiteSpace(e.Parameter as string))
|
|
return;
|
|
|
|
string[] param = (e.Parameter as string).Split('/');
|
|
|
|
switch (param[0])
|
|
{
|
|
case "about":
|
|
case "info":
|
|
PivotControl.SelectedItem = AboutTab;
|
|
break;
|
|
case "inbox":
|
|
case "message":
|
|
case "changelog":
|
|
PivotControl.SelectedItem = InboxTab;
|
|
if (param.Length > 1)
|
|
InboxSection.Open(param[1]);
|
|
break;
|
|
default:
|
|
PivotControl.SelectedItem = PreferencesTab;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
} |