Can you disable the DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION flag?...

Oct 10, 2014 at 10:22 PM
Hi

How do I disable DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION, because I'm testing the Application.UnhandledException and it keeps breaking here:
    partial class App : global::Microsoft.Practices.Prism.Mvvm.MvvmAppBase
    {
            ...
            ..
            .
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
            UnhandledException += (sender, e) =>
            {
                if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
            };
#endif
        }
    }
.., but for now I don't want it to stop in the App.g.i.cs file. I'm successfully doing this:
        public App()
        {
            this.InitializeComponent();
            this.RequestedTheme = ApplicationTheme.Light;
            // ensure general app exceptions are handled
            UnhandledException += App_UnhandledException;
        }

        private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            NathsarTS.UILogic.Interfaces.IAlertMessageService alertMessageService = ServiceLocator.Current.GetInstance<NathsarTS.UILogic.Interfaces.IAlertMessageService>();
            IResourceLoader resourceLoader = ServiceLocator.Current.GetInstance<IResourceLoader>();

            e.Handled = true;
            StringBuilder sMsg = new StringBuilder();

            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.UnhandledExceptionMessage)).Append(e.Message).AppendLine();
            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.ExceptionMessage)).Append(e.Exception.Message).AppendLine();
            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.ExceptionInnerException)).Append(e.Exception.InnerException).AppendLine();
            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.ExceptionSource)).Append(e.Exception.Source).AppendLine();
            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.ExceptionStackTrace)).Append(e.Exception.StackTrace).AppendLine();

#if (DEBUG)
            sMsg.Append(resourceLoader.GetString(NathsarTS.Common.Models.CommonNames.ExceptionHelpLink)).Append(e.Exception.HelpLink).AppendLine();
            Debug.WriteLine(sMsg.ToString());
#endif

            await alertMessageService.ShowAsync(sMsg.ToString(), resourceLoader.GetString("UnhandledException"));
        }
Is this possible?

Thanks!...