赋值后未达到设置属性
我的 WPF 项目的 ViewModel 中有一个属性
private Patient _Patient;
[BindableProperty]
public virtual Patient Patient
{
get { return _Patient; }
set
{
_Patient = value;
if (FormParameter != null) FormParameter.Value.Patient = Patient;
InitializePatientSummary();
}
}
,并且有一个简单的命令来显示确认弹出窗口。如果是,我重新分配患者财产。
private void DeleteMDM()
{
if (ConfirmDelete(Resources.PatientFile_ConfirmDelete_Title,
Resources.PatientFile_ConfirmDelete_Body_MDM,
FormParameter.Value.MDM))
{
var mdm = FormParameter.Value.MDM;
//_mdmController.Remove(mdm);
Patient = FormParameter.Value.Tumor.Patient;
ShowTumorImpl(FormParameter.Value.Tumor);
FormParameter.Value.RaisePropertyChanged(x => x.Tumor);
}
}
此行 _mdmController.Remove(mdm);
已被注释,因为它是一个异步操作,我想看看它是否是问题的根源,但事实并非如此。
在受让人之前,我检查了立即窗口 Patient == FormParameter.Value.Tumor.Patient
并且它返回 false。
仅供参考,我正在使用 DevExpress 框架,并且此 ViewModel 没有 [POCOViewModel] 属性。
这显然是一个基本操作,但我找不到为什么患者没有更新
I have a property in a ViewModel of my WPF project
private Patient _Patient;
[BindableProperty]
public virtual Patient Patient
{
get { return _Patient; }
set
{
_Patient = value;
if (FormParameter != null) FormParameter.Value.Patient = Patient;
InitializePatientSummary();
}
}
and I have a simple command to show a confirmation popup. If YES, I reassign Patient property.
private void DeleteMDM()
{
if (ConfirmDelete(Resources.PatientFile_ConfirmDelete_Title,
Resources.PatientFile_ConfirmDelete_Body_MDM,
FormParameter.Value.MDM))
{
var mdm = FormParameter.Value.MDM;
//_mdmController.Remove(mdm);
Patient = FormParameter.Value.Tumor.Patient;
ShowTumorImpl(FormParameter.Value.Tumor);
FormParameter.Value.RaisePropertyChanged(x => x.Tumor);
}
}
This line _mdmController.Remove(mdm);
is commented because it's an async operation and I would see if it can be the source of the issue but it doesn't.
Before assignee, I checked in the Immediate window Patient == FormParameter.Value.Tumor.Patient
and it returns false.
FYI, I'm using DevExpress framework and this ViewModel doesn't have the [POCOViewModel] attribute.
It's clearly a basic operation but I can't find why the patient is not updated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论