【发布时间】:2010-11-08 23:23:42
【问题描述】:
我有一个带有这个主窗体的 WinForms 应用程序:
ICountRepository countRepository;
public MainForm(ICountRepository countRepository)
{
this.countRepository = countRepository;
}
public void IncrementCount()
{
countRepository.IncrementCount();
}
但我正在努力将ICountRepository 注入主窗体。我该怎么做?
【问题讨论】: