[Go] Main method of WPF

Source: Internet
Author: User
Tags in domain

The WPF program throws such an error:

Program ' SQLiteManager.exe ' does isn't contain a static ' Main ' method suitable for an entry point

The problem arises from the fact that I created a WPF application, I excluded the App.xaml file from the project, and then I included it, and this inadvertent operation created a problem, and I learned the WPF build action. When the build action is set to ApplicationDefinition, the WPF program generates the static ' Main ' method.

Like WinForm, WPF also needs a application to govern some global behavior and operations, and only one application instance exists in each Domain.

Application provides a number of useful properties and methods.
Current: Gets the default application instance in Domain.
MainWindow: Gets the main window instance.
Windows: Gets all instances of the Window that are instantiated.
Shutdownmode: Specifies the Application.shutdown mode, including the main form close, the last window closes, and the manual call to Shutdown ().
Properties: A thread-safe global dictionary that can be used to store a common information.
Shutdown: This method terminates application Process, which returns an exit code to the operating system.

[Go] Main method of WPF

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.