WPF - Shut-off autogen of Main in App.g.cs

后端 未结 6 1043
情话喂你
情话喂你 2021-02-02 16:06

I\'m learning WPF.

I want to provide my own Main method in my App.xaml.cs rather than getting one generated for me in App.g.cs. However I keep getting conflicts because

6条回答
  •  感情败类
    2021-02-02 16:59

    I found a solution:

    1. Copy the data from your app.xaml file
    2. Delete app.xaml file and re-create with the same name
    3. Create `main` method in .cs file, and paste your old copied code into it

提交回复
热议问题