} // ctor public PpsTagItemModel(PpsObject ppsObject, PpsObjectTagBase tag) { this.ppsObject = ppsObject; this.tag = tag; this.currentClass = tag.Class; } // ctor
} // proc BeginEdit public void EndEdit() { // check if in edit mode CheckEditMode(); // update the tag behind if (IsNew) { ppsObject.Tags.AppendUserTag(ppsObject.Environment.UserId, new PpsObjectTag(currentName, currentClass, currentValue)); AttachPropertyChanged(); } else if (currentName != tag.Name) { var tmp = tag; tag = null; // remove tag, that refresh will not remove this item ((PpsObjectUserTag)tmp).Remove(); DetachPropertyChanged(); ppsObject.Tags.AppendUserTag(ppsObject.Environment.UserId, new PpsObjectTag(currentName, currentClass, currentValue)); AttachPropertyChanged(); } else if (!Equals(tag.Value, currentValue)) { ((PpsObjectUserTag)tag).UpdateValue(currentClass, currentValue); } isEditing = false; isModified = false; if (ppsObject.IsChanged) { ppsObject.UpdateLocalAsync().AwaitTask(); } } // proc EndEdit
public PpsTagItemModel(PpsObject ppsObject, PpsObjectTagClass newClass) { this.ppsObject = ppsObject; this.tag = null; this.currentClass = newClass; } // ctor