在我的 C# WPF 应用程序中,我有以下内容:
ObservableCollection<SpecialtyFees> _SpecialtyFeeEGG;
public ObservableCollection<SpecialtyFees> SpecialtyFeeEGG
{
get { return _SpecialtyFeeEGG; }
set
{
if (_SpecialtyFeeEGG == value)
return;
_SpecialtyFeeEGG = value;
RaisePropertyChanged("SpecialtyFeeEGG");
}
}
执行以下行时,将调用 SET 方法,如我所料:
SpecialtyFeeEGG = new ObservableCollection<SpecialtyFees>();
但是,稍后在代码中,将 specialFee 添加到 SpecialtyFeeEGG 时,它不会被调用,我希望它会被调用。我错过了什么?
foreach (var item in Specialties)
{
SpecialtyFees specialtyFee = new SpecialtyFees();
specialtyFee.SpecialtyCode = item.SpecialtyCode;
specialtyFee.CurrentTotal = 0;
specialtyFee.BidTotal = 0;
specialtyFee.BidDifference = 0;
if (specialtyFee.SpecialtyCode.Length == 3)
{
SpecialtyFeeEGG.Add(specialtyFee);
}
}
qq_花开花谢_0
DIEA
慕侠2389804
相关分类