源码地址:https://github.com/lizhiqiang0204/-WpfApp2.git
首先利用WPF向导创建一个空的项目
using System.Windows; namespace WpfApp2 { /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
<Window x:Class="WpfApp2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation