新建wpf应用程序
新建Window1.xaml
<DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Button Name="button1" Margin="60">点我</Button>
</DockPanel>
新建Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace WpfApp3
{
public class Program : Application
{
[STAThread]
static void Main()
{
var app = new Program();
app.MainWindow = new MainWindow(@"G:\Dotnet\WPF\wpfstudy\WpfApp3\Window1.xaml");
app.MainWindow.ShowDialog();
}
}
}