如何撤销对自我跟踪实体所做的所有更改? [英] How do I undo all changes made to a Self-Tracking Entity?

查看:153
本文介绍了如何撤销对自我跟踪实体所做的所有更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端应用程序通过WCF下载了一些STE。

I have a client application that downloads a number of STE's via WCF.

使用WPF应用程序,用户可以从ListBox中选择一个实体,并通过弹出式UserControl进行编辑。由于UserControl直接绑定到对象,当用户进行更改时,它当然会影响对象。

Using a WPF application, users can select an entity from a ListBox, and edit it via a popup UserControl. As the UserControl is bound directly to the object, when a user makes a change it of course affects the object.

我想提供一个取消功能,将撤消对实体所做的所有更改。

任何想法?

推荐答案

您可以保留该实体的原始副本。并编辑它的克隆版本。

如果用户取消更改,只需继续使用原始副本。

You can keep a original copy of the entity. And edit a cloned version of it.
If the user cancels the changes you simply keep using the original copy.

这篇关于如何撤销对自我跟踪实体所做的所有更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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