Created
April 18, 2017 20:05
-
-
Save dansiegel/d6827a98788e76c4e313ccffe99d1993 to your computer and use it in GitHub Desktop.
Prism Debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App : PrismApplication | |
{ | |
public App(IPlatformInitializer initializer = null) : base(initializer) | |
{ | |
} | |
protected override void OnInitialized() | |
{ | |
try | |
{ | |
// The most common problem when a view does not appear is an initialization exception. | |
Container.Resolve<object>("ViewA"); | |
Container.Resolve<ViewModels.ViewAViewModel>(); | |
// In the event that you got here then you can begin debugging by initializing INavigationAware | |
// ViewModels and/or manually setting the Application MainPage. This will likely result in an exception | |
// being thrown to help diagnose exactly where your problem is. | |
} | |
catch(Exception e) | |
{ | |
System.Diagnostics.Debug.WriteLine("Whoops, looks like we threw an exception..."); | |
System.Diagnostics.Debug.WriteLine(e); | |
} | |
NavigationService.NavigateAsync("ViewA"); | |
} | |
protected override void RegisterTypes() | |
{ | |
Container.RegisterTypeForNavigation<ViewA>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment