Exception in DataContextChanged event

Rousselle, Holger 1 Reputation point
2021-03-11T06:28:14.087+00:00

If there is an exception in the DataContextChanged event, the exception will stop displaying the MainPage, but the app is still running.
The same behavior when an exception is thrown in the DataContextChanged event of controls on the MainPage.
The exception can't be catched when adding UnhandledException += OnUnhandledException; in the App.cs

Added a small blank UWP app where an exception is thrown in the DataContextChanged of the MainPage.

https://drive.google.com/file/d/1yNJM9p2RdD06Z115vvnYyTYU_R8K6BN8/view?usp=sharing

Developer technologies | Universal Windows Platform (UWP)
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.