WPF Professional Programming Guide-Dispatcherunhandledexception

Source: Internet
Author: User

There is one event in the application class for WPF: Dispatcherunhandledexception, which occurs when the application does not handle the exception, thus putting the final door for the application.

1 namespaceChapter1_wpfapplication12 {3     /// <summary>4     ///Interaction logic for App.xaml5     /// </summary>6      Public Partial classapp:application7     {8         protected Override voidOnstartup (StartupEventArgs e)9         {Ten             Base. Onstartup (e); One  A              This. Dispatcherunhandledexception + =app_dispatcherunhandledexception; -         } -  the         voidApp_dispatcherunhandledexception (Objectsender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) -         { -             Throw Newnotimplementedexception (); -         } +     } -}
View Code

Obviously, this can be used as a backup method, but it is not possible to rely on it to solve the problem proactively, or to have a good habit of catching anomalies.

WPF Professional Programming Guide-Dispatcherunhandledexception

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.