WPF的ObservableCollection编辑模式 [英] WPF ObservableCollection Edit Mode

查看:544
本文介绍了WPF的ObservableCollection编辑模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用所有在我的应用程序可观察的集合。我的问题是,当我使用弹出窗口编辑这些实体,我的绑定列表越来越当用户更改窗口的相应字段改变。

I am using observable collections all around my applications. My problem is that when i use a popup window for editing those entities, my bound lists are getting changed when the user changes those corresponding fields in the window.

如何能简单地冻结观察到的变化norifications,并释放他们,只有当实体保存?

How could i simply freeze the observable changes norifications, and release them only when the entity is saved?

谢谢,
奥兰

推荐答案

您可以做一个的对象的深层副本要编辑。这样一来,就可以在编辑,而不保留在列表中的原始干扰上的副本行事。一旦你`重新完成编辑,您可以通过编辑后的版本或回滚替换原来的。

You could make a deep copy of the object you want to edit. This way, you can act on the copy while editing, without interfering with the original that remains in the list. Once you`re done editing, you can replace the original by the edited version or rollback.

这篇关于WPF的ObservableCollection编辑模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆