public BrandView(BrandView original) { this.id = original.id; this.name = original.name; this.image = original.image; this.webSite = original.webSite; }
/// <summary> /// Copy values back to this object from a cached object /// </summary> /// <param name="origianl"></param> public void Restore(BrandView cachedObject) { this.id = cachedObject.id; this.name = cachedObject.name; this.image = cachedObject.image; this.webSite = cachedObject.webSite; }
/// <summary> /// 'Cancel' button is clicked /// </summary> public void CancelEdit() { Restore(cache); cache = null; }
/// <summary> /// 'Edit' button is clicked /// Due to binding, all UI changed will be mapped to the object, so we need make a copy of object before edit in case user wants to cancel the editing /// </summary> public void BeginEdit() { cache = new BrandView(this); }