コード例 #1
0
        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());
                }
            });
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 public AtomViewModel()
 {
     appNavigator        = Get <IAppNavigator>();
     notificationService = Get <INotificationService>();
     Reload();
 }