【发布时间】:2009-05-12 13:26:55
【问题描述】:
我定义了以下视图:
<CollectionViewSource x:Key="PatientsView" Source="{Binding Source={x:Static Application.Current}, Path=Patients}"/>
其中 Patient 是以下属性:
public IEnumerable<Patient> Patients
{
get
{
return from patient in Database.Patients
orderby patient.Lastname
select patient;
}
}
在我的代码中的某处,我更改了患者数据库,并且我希望自动通知显示此数据的控件(使用“PatientsView”)。这样做的正确方法是什么? CollectionViewSource 可以失效还是什么?
【问题讨论】: