Archived
1
0
This repository has been archived on 2026-04-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FoxTube/FoxTube/Pages/Settings.xaml.cs
T
2019-07-19 17:19:43 +03:00

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;
}
}
}
}