Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

How to detect XAML exceptions?

$
0
0

Every once in a while some of my XAML pages are not loading.

For example,

  • in Page A i click on a button that should open Page B
  • the Page B constructor executes
  • but the page doesn't open
  • i use Prism, and the OnNavigatedTo even does not fire

Most times it's because I use bindings, or static resources and i forget to define them due to copy and paste.
This is a nightmare to debug, because i don't get an exception, and neither a message in the output window like "Cannot resolve resource xyz".

I already use [assembly: XamlCompilation(XamlCompilationOptions.Compile)] at an app level, but it doesn't detect these kinds of bugs.

So, how can i figure out what the error is? There must be some place where these exceptions (if they are exceptions) are logged.

Right now my only option is to comment out elements one by one until i find out which one was causing the bug, which is a huge waste of time.

Thank you!


Viewing all articles
Browse latest Browse all 89864

Trending Articles