Win8 - Unhandled exception in Windows.UI.Xaml.dll

8

I've got some strange behavior while debugging/running my metro app. During drag'n'drop the screen will be refreshed. I'd added some functionality to block binded properties from refreshing while drag'n'drop is in progress.

But sometimes the app crash, but in stead of throwing some exception which I can debug, all I got is an window saying to open an external just-in-time-debugger

An unhandled win32 exception occurred in SOME_APP.exe [7785].

(The external debugger does not bring more information)

And the output says:

Unhandled exception at 0x05017145 (Windows.UI.Xaml.dll) in SOME_APP.exe: 0xC0000005: Access violation reading location 0x00000088.

I'm working on a x64 device. Has somebody ever heard of such problem?

winapi
xaml
windows-8
unhandled-exception
asked on Stack Overflow Aug 9, 2012 by salcosand • edited Aug 29, 2013 by McGarnagle

1 Answer

11

If you're passing objects implemented INotifyPropertyChanged, inherited BindableBase or DependencyObject etc. thru NavigationParameter; and bind then in the NavigatedPage (or binded them in the navigating page) you'll most likely get this error. Don't pass any object except primitive type thru NavigationParameter when navigating.

You are getting this exception because non-existent referenced methods. For example.

  1. You have an object named Categories which inherites BindableBase.
  2. You binded that to Home.xaml.
  3. Home.xaml's binding mechanism subscribed the PropertyChanged event of Categories object.
  4. You navigated the Article.xaml passing Categories object as a the NavigationParameter.
  5. You binded the Categories object to Article.xaml.
  6. When a property changes in Categories object; that property will fire PropertyChanged event.
  7. There are two subscribers to that event. Home.xaml and Article.xaml, but Home.xaml is no longer exist since you navigated away from it. But your delegate holds the address of it; so it tries to Execute; and fail with Access violation error.
answered on Stack Overflow Sep 28, 2012 by Medeni Baykal

User contributions licensed under CC BY-SA 3.0