没有main()在WPF? [英] No Main() in WPF?
本文介绍了没有main()在WPF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是当它涉及到编程,但是我确信的普遍规则是,一个程序与主开始()非常初学者。我看不出之一,当我创建一个WPF项目。主要是()简单地命名为不同的东西在WPF?
I am very beginner when it comes to programming but I was sure that one of the universal rules was that an program starts with Main(). I do not see one when I create a WPF project. Is Main() simply named something differently in WPF?
推荐答案
这是构建过程中产生的,但你可以提供自己的(在必要项目的属性歧义的话)。看在OBJ /调试的应用程序文件;我有 App.g.i.cs
带(的C#2010前preSS提供):
It is generated during build, but you can provide your own (disambiguating it in project-properties as necessary). Look in obj/debug for an app file; I have (courtesy of "C# 2010 Express") App.g.i.cs
with:
namespace WpfApplication1 {
/// <summary>
/// App
/// </summary>
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent() {
#line 4 "..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static void Main() {
WpfApplication1.App app = new WpfApplication1.App();
app.InitializeComponent();
app.Run();
}
}
}
这篇关于没有main()在WPF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文