Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 616
salcosand Avatar asked Aug 09 '12 09:08

salcosand


1 Answers

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.
like image 192
Medeni Baykal Avatar answered Oct 24 '22 06:10

Medeni Baykal