1
我对Winforms的Castle Windsor场景的适当实现感到困惑,我发现的所有文档都是关于WCF和ASP.NET MVC的,所以我寻求帮助在Windows Forms中正确执行Castle Windsor。现在,这里是我的代码... 我开始MVP http://dotnetchris.wordpress.com/2009/02/16/creating-a-generic-model-view-presenter-framework/如何以及在哪里设置适用于MVP Winforms的Castle Windsor v2.5正确
的这种做法考取到的WinForms我做了这个
public interface IPresenter<TViewModel>
{
TViewModel View { get; set; }
event EventHandler ViewInitialized;
void OnViewInitialized(EventArgs e);
event EventHandler ViewLoaded;
void OnViewLoaded(EventArgs e);
}
和基本形式是
public partial class MvpForm<TPresenter, TViewModel> : Form
where TPresenter : IPresenter<TViewModel>
where TViewModel : class
后的第一部分我的演示者是
public class PatientSearchCreatePresenter: IPresenter<IPatientFilterViewModel>
{
IPatientBusinessService patient;
/// <summary>
/// Initializes a new instance of the <see cref="PatientFilterPresenter" /> class.
/// </summary>
public PatientSearchCreatePresenter(IPatientBusinessService Patient)
{
patient = Patient;
}
和我的表单来搜索和创建病人是这样的
public partial class FormSearchCreatePatient : MvpForm<PatientSearchCreatePresenter,IPatientSearchCreateViewModel> , IPatientSearchCreateViewModel
{
在哪里,我应该如何执行城堡组件的安装&注册为浏览和演示服务属性
感谢你这么多
谢谢我遵循相同的方法,并工作 – Kmilo 2013-02-14 16:45:50