public static void Navigate(Type type) { Current.Detail = new ContentPage { }; if (Device.Idiom != TargetIdiom.Tablet) { Current.IsPresented = false; } Device.BeginInvokeOnMainThread(async() => { try { await Task.Delay(1000); NavigationPage page = null; if (!cache.TryGetValue(type, out page)) { //ContentPage cp = (ContentPage)Activator.CreateInstance(type); IAppNavigator navigator = DependencyService.Get <IAppNavigator>(DependencyFetchTarget.GlobalInstance); var p = await navigator.NewPage(type); page = new NavigationPage(p); cache[type] = page; } Current.Detail = page; } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } }); }
/// <summary> /// /// </summary> public AtomViewModel() { appNavigator = Get <IAppNavigator>(); notificationService = Get <INotificationService>(); Reload(); }