void IEditableObject.CancelEdit() { foreach (var info in CurrentModel.GetType().GetProperties()) { if (!info.CanRead || !info.CanWrite) { continue; } var oldValue = info.GetValue(Cache, null); CurrentModel.GetType().GetProperty(info.Name).SetValue(CurrentModel, oldValue, null); } }
void IEditableObject.BeginEdit() { Cache = ViewModelSource.Create(() => new WizardDataModel()); foreach (var info in CurrentModel.GetType().GetProperties()) { if (!info.CanRead || !info.CanWrite) { continue; } var oldValue = info.GetValue(CurrentModel, null); Cache.GetType().GetProperty(info.Name).SetValue(Cache, oldValue, null); } }
public void BeginEdit() { Cache = Activator.CreateInstance <T>(); //Set Properties of Cache foreach (var info in CurrentModel.GetType().GetProperties()) { if (!info.CanRead || !info.CanWrite) { continue; } var oldValue = info.GetValue(CurrentModel, null); Cache.GetType().GetProperty(info.Name).SetValue(Cache, oldValue, null); } }