我有一個類Application
,我需要用INotifyPropertyChanged事件重寫。我寫了邏輯覆蓋原來的類,並最終創建SuperApplication
C#強制類重寫類
我從數據庫拉數據雖然,並且不能更改加載邏輯。我只需要一種將原始類中的數據導入到我的超類中的方法。我已經嘗試過像superClass = (SuperApplication)standardClass;
之類的東西,但它沒有奏效。
我該如何去做這件事?
如果有幫助,這是我使用重寫原來的類代碼:
public class SuperCreditApplication : CreditApplication
{
public SuperCreditApplicant Applicant { get; set; }
public SuperCreditApplicant CoApplicant { get; set; }
}
public class SuperCreditApplicant : CreditApplicant
{
public SuperProspect Prospect { get; set; }
}
public class SuperProspect : Prospect, INotifyPropertyChanged
{
public State DriverLicenseState
{
get
{
return DriverLicenseState;
}
set
{
DriverLicenseState = value;
OnPropertyChanged("DriverLicenseState");
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
你能告訴我們來自'Application'和'SuperApplication'的代碼(或代碼示例)嗎?謝謝。 – 2012-07-09 20:30:39
我剛添加它。 – 2012-07-09 20:31:31