a792132428
Updated and enchanced MainPage Updated Core
35 lines
879 B
C#
35 lines
879 B
C#
namespace FoxTube
|
|
{
|
|
public enum NavigationTarget
|
|
{
|
|
Home,
|
|
Settings,
|
|
Downloads
|
|
}
|
|
|
|
public static class Navigation
|
|
{
|
|
public static NavigationTarget CurrentPage { get; private set; }
|
|
public static object CurrentParameter { get; private set; }
|
|
|
|
public static void NavigateTo(NavigationTarget destination) =>
|
|
NavigateTo(destination, null);
|
|
|
|
public static void NavigateTo(NavigationTarget destination, object parameters)
|
|
{
|
|
MainPage.Current.Navigate(destination switch
|
|
{
|
|
NavigationTarget.Settings => typeof(Views.Settings),
|
|
NavigationTarget.Downloads => typeof(Views.Downloads),
|
|
_ => UserManagement.Authorized ? typeof(Views.Home) : typeof(Views.HomeSections.Trending),
|
|
},
|
|
parameters);
|
|
|
|
CurrentPage = destination;
|
|
CurrentParameter = parameters;
|
|
}
|
|
|
|
public static void RefreshCurrentPage() =>
|
|
MainPage.Current.Refresh();
|
|
}
|
|
} |