public static void RegisterAll <TView>() { var views = Enum.GetValues(typeof(TView)).Cast <TView>(); foreach (TView view in views) { MemberInfo viewInfo = typeof(TView).GetMember(view.ToString()).FirstOrDefault(); ViewTypeAttribute viewType = viewInfo.GetCustomAttributes <ViewTypeAttribute>().FirstOrDefault(); if (viewType != null) { NavigationServiceHelper <TView> .RegisterView(view, viewType.ViewType); } } }
public static void RegisterAll <TView>() { var views = Enum.GetValues(typeof(TView)).Cast <TView>(); foreach (TView view in views) { MemberInfo viewInfo = typeof(TView).GetMember(view.ToString()).FirstOrDefault(); DescriptionAttribute description = (DescriptionAttribute)viewInfo.GetCustomAttributes(typeof(DescriptionAttribute)).FirstOrDefault(); if (description != null) { NavigationServiceHelper <TView> .RegisterView(view, description.Description); } } }
public static void Navigate(this NavigationService navigationService, String pageUri) { NavigationServiceHelper.Navigate(pageUri); }
/// <summary> /// Simple helper method that allows us to navigate to a page using a strongly typed /// page reference without needing to explicitly specify the type twice. /// </summary> /// <typeparam name="TView">The type of the view to navigate to</typeparam> /// <param name="view">The view to navigate to</param> public static void Navigate <TView>(TView view) { NavigationServiceHelper <TView> .Navigate(view); }
/// <summary> /// Simple helper method that allows us to navigate to a page using a strongly typed /// page reference without needing to explicitly specify the type twice. /// </summary> /// <typeparam name="TView">The type of the view to navigate to</typeparam> /// <param name="view">The view to navigate to</param> public static void Navigate <TView>(TView view, object parameter = null) { NavigationServiceHelper <TView> .Navigate(view, parameter); }