70 lines
2.2 KiB
C#
70 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices.WindowsRuntime;
|
|
using Windows.ApplicationModel;
|
|
using System.Globalization;
|
|
using Windows.Foundation;
|
|
using Windows.Foundation.Collections;
|
|
using Windows.Storage;
|
|
using Windows.UI.Text;
|
|
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;
|
|
using FoxTube.Pages.SettingsPages;
|
|
|
|
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
|
|
|
|
namespace FoxTube
|
|
{
|
|
/// <summary>
|
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
|
/// </summary>
|
|
public sealed partial class Settings : Page
|
|
{
|
|
bool inboxLoaded = false;
|
|
public Settings()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
|
{
|
|
base.OnNavigatedTo(e);
|
|
if(!string.IsNullOrWhiteSpace(e.Parameter as string))
|
|
{
|
|
if ((e.Parameter as string).Contains("inbox"))
|
|
{
|
|
pivot.SelectedIndex = 3;
|
|
if ((string)e.Parameter != "inbox")
|
|
((pivot.SelectedItem as PivotItem).Content as Inbox).Open((e.Parameter as string).Split('&')[1]);
|
|
}
|
|
else
|
|
switch(e.Parameter as string)
|
|
{
|
|
case "about":
|
|
pivot.SelectedIndex = 2;
|
|
break;
|
|
case "translate":
|
|
pivot.SelectedIndex = 3;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
if (pivot.SelectedIndex == 2 && !inboxLoaded)
|
|
{
|
|
(((pivot.Items[2] as PivotItem).Content as ScrollViewer).Content as Inbox).LoadItems();
|
|
inboxLoaded = true;
|
|
}
|
|
}
|
|
}
|
|
}
|