本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}