一、修改App.xaml
删除启动的Uri(StartupUri=“MainWindow.xaml”)
二、修改App.xaml.cs
1、集成Microsoft.Extensions.DependencyInjection
2、重写OnStartUp方法
var services = new ServiceCollection();
services.AddSingleton<MainWindow>();
services.AddSingleton<UserControl1>();
services.AddTransient<ITest,