当前位置: 首页>>代码示例>>C#>>正文


C# UINavigationController.PopToRootViewController方法代码示例

本文整理汇总了C#中UINavigationController.PopToRootViewController方法的典型用法代码示例。如果您正苦于以下问题:C# UINavigationController.PopToRootViewController方法的具体用法?C# UINavigationController.PopToRootViewController怎么用?C# UINavigationController.PopToRootViewController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UINavigationController的用法示例。


在下文中一共展示了UINavigationController.PopToRootViewController方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            StampInstallDate();

            RxApp.DefaultExceptionHandler = Observer.Create((Exception e) =>
            {
                Locator.Current.GetService<IAlertDialogService>().Alert("Error", e.Message);
                Console.WriteLine("Exception occured: " + e.Message + " at " + e.StackTrace);
            });

            // Load the IoC
            Services.Registrations.InitializeServices(Locator.CurrentMutable);

            var viewModelViewService = Locator.Current.GetService<IViewModelViewService>();
            viewModelViewService.RegisterViewModels(typeof(IApplicationService).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            // Install the theme
            SetupTheme();

            var startupViewController = new StartupViewController { ViewModel = new StartupViewModel(Locator.Current.GetService<IApplicationService>()) };
            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds) {RootViewController = mainNavigationController};
            Window.MakeKeyAndVisible ();
            return true;
        }
开发者ID:memopower,项目名称:RepoStumble,代码行数:41,代码来源:AppDelegate.cs

示例2: FinishedLaunching

        /// <summary>
        /// Finished the launching.
        /// </summary>
        /// <param name="app">The app.</param>
        /// <param name="options">The options.</param>
        /// <returns>True or false.</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
//			var iRate = MTiRate.iRate.SharedInstance;
//			iRate.AppStoreID = 707173885;


            // Stamp the date this was installed (first run)
            StampInstallDate();

            // Load the IoC
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Core.Services.IDefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.Core.Services.IAccountsService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(CodeFramework.iOS.Theme).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(typeof(Core.Services.IApplicationService).Assembly);
            IoC.RegisterAssemblyServicesAsSingletons(GetType().Assembly);

            var viewModelViewService = IoC.Resolve<IViewModelViewService>();
            viewModelViewService.RegisterViewModels(typeof(Xamarin.Utilities.Services.DefaultValueService).Assembly);
            viewModelViewService.RegisterViewModels(typeof(CodeFramework.iOS.Theme).Assembly);
            viewModelViewService.RegisterViewModels(GetType().Assembly);

            IoC.Resolve<IErrorService>().Init("http://sentry.dillonbuchanan.com/api/5/store/", "17e8a650e8cc44678d1bf40c9d86529b ", "9498e93bcdd046d8bb85d4755ca9d330");
            CodeHub.Core.Bootstrap.Init();


            Theme.Setup();
            SetupPushNotifications();
            HandleNotificationOptions(options);

            var startupViewController = new StartupView { ViewModel = IoC.Resolve<StartupViewModel>() };
            startupViewController.ViewModel.View = startupViewController;

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ =>
            {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            Window = new UIWindow(UIScreen.MainScreen.Bounds) {RootViewController = mainNavigationController};
            Window.MakeKeyAndVisible();
            return true;
        }
开发者ID:GSerjo,项目名称:CodeHub,代码行数:50,代码来源:AppDelegate.cs

示例3: GoToStartupView

        private void GoToStartupView()
        {
            var serviceConstructor = Locator.Current.GetService<IServiceConstructor>();
            var vm = serviceConstructor.Construct<StartupViewModel>();
            var startupViewController = new StartupViewController {ViewModel = vm};

            var mainNavigationController = new UINavigationController(startupViewController) { NavigationBarHidden = true };
            MessageBus.Current.Listen<LogoutMessage>().Subscribe(_ => {
                mainNavigationController.PopToRootViewController(false);
                mainNavigationController.DismissViewController(true, null);
            });

            TransitionToViewController(mainNavigationController);
        }
开发者ID:vbassini,项目名称:CodeHub,代码行数:14,代码来源:AppDelegate.cs

示例4: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			var fonts = MakeFonts ();
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			dialog = new DialogViewController (fonts);
			var nav = new UINavigationController (dialog);
			window.RootViewController = nav;
			window.MakeKeyAndVisible ();

			UIApplication.Notifications.ObserveContentSizeCategoryChanged (delegate {
				dialog.Root = MakeFonts ();
				nav.PopToRootViewController (false);
			});
			return true;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:15,代码来源:AppDelegate.cs


注:本文中的UINavigationController.PopToRootViewController方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。