【发布时间】:2009-07-18 16:48:45
【问题描述】:
我正在尝试在 WPF 中创建我的 hello world windows 应用程序。
我应该怎么做才能运行这个窗口?
Class1.xaml
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid> </Grid>
</Window>
App.xaml
<Application x:Class="App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Class1.xaml" >
<Application.Resources>
</Application.Resources>
</Application>
程序.cs
class Program
{
[STAThread]
public static void Main()
{
new App().Run();
}
}
我创建了一个空白 sln 并添加了这三个文件。我还添加了 WindowsBase、PresentationBase、PresentationFramework 参考。
但应用程序没有运行。
有什么问题?
【问题讨论】: