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