Dependency Injection in .NET Core 3.0 for WPF
问题 I’m quite familiar with ASP.NET Core and the support for dependency injection out of the box. Controllers can require dependencies by adding a parameter in their constructor. How can dependencies be achieved in WPF UserControls? I tried adding a parameter to the constructor, but that didn’t work. I love the IOC concept and would prefer to bring this forward to WPF. 回答1: I have recently come across this requirement to my project and I solved it this way. For Dependency Injection in .NET Core 3