更新时间:2023-01-30 08:31:35
在正常情况下,WPF创建主
方法(应用程序的入口点)为您。您的选择
Under normal circumstances, WPF creates the Main
method (the entrypoint of the application) for you. Your options
Application.Startup
事件,并把你的代码中有。或者,您可以覆盖 OnStartup()
方法。应用
的参构造器(它可能不存在,但你可以创建一个)。的Main()
方法。 有几种方法如何做到这一点。也许最简单的就是把它放在另一个类,并告诉Visual Studio中要在项目的属性来使用这个方法。Application.Startup
event and put your code there. Alternatively, you can override the OnStartup()
method.App
's parameterless constructor (it probably doesn't exist, but you can create it).Main()
method. There are several ways how to do that. Probably the easiest is to put it in another class and tell Visual Studio you want to use this method in the project's properties.在该另一方面,你说你得到一些不起眼的XAML解析错误。也许你应该弄清楚究竟是什么意思呢?
On the other hand, you said you're getting some obscure XAML parsing errors. Maybe you should figure out what exactly do they mean?