54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using Windows.UI.Xaml.Controls;
|
|
using Windows.UI.Xaml.Navigation;
|
|
using FoxTube.Pages.SettingsPages;
|
|
using FoxTube.Classes;
|
|
|
|
namespace FoxTube
|
|
{
|
|
/// <summary>
|
|
/// Settings tabs placeholder
|
|
/// </summary>
|
|
public sealed partial class Settings : Page, INavigationPage
|
|
{
|
|
public object Parameter { get; set; } = null;
|
|
|
|
bool inboxLoaded = false;
|
|
string inboxId = null;
|
|
public Settings() =>
|
|
InitializeComponent();
|
|
|
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
{
|
|
base.OnNavigatedTo(e);
|
|
Parameter = e.Parameter;
|
|
|
|
if(!string.IsNullOrWhiteSpace((string)e.Parameter))
|
|
switch((string)e.Parameter)
|
|
{
|
|
case "about":
|
|
pivot.SelectedItem = aboutTab;
|
|
break;
|
|
case "translate":
|
|
pivot.SelectedItem = translateTab;
|
|
break;
|
|
default:
|
|
inboxId = (string)e.Parameter;
|
|
pivot.SelectedItem = inboxTab;
|
|
break;
|
|
}
|
|
|
|
Navigation.Frame.Frame.LoadingPage.Close();
|
|
}
|
|
|
|
void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if (pivot.SelectedItem == inboxTab && !inboxLoaded)
|
|
{
|
|
inbox.LoadItems(inboxId);
|
|
inboxLoaded = true;
|
|
inboxId = null;
|
|
}
|
|
}
|
|
}
|
|
}
|