我尝试这两个例子中一个WPF应用程序以使用启动事件:如何在WPF应用程序中使用启动事件?
http://www.wpf-tutorial.com/wpf-application/working-with-app-xaml/
https://msdn.microsoft.com/en-us/library/system.windows.application.startup(v=vs.110).aspx
每会在局部应用类的方法:
void Application_Start(object sender, StartupEventArgs args){
//do something
}
并在App.xaml中指向它:
Startup = "Application_Start"
我总是得到这样的生成错误:
MyApp.App does not contain a definition for Application_Start and no extension method Application_Start accepting a first arument of type MyApp.App could be found.
任何想法我做错了吗?
您是否可以看到足以查看包含t的类所用的命名空间他Application_Start和你的app.xaml中使用的命名空间? – HoboCannibaL