public void Add(IEnumerable <string> existingNames) { _isAdd = true; Title = "New Template"; _fieldsChanged = false; InitPredefinedFieldValues(); ResetFieldValuesForAllBuffers(); _unmodifiedValue = Container.Resolve <TemplateDialogViewModel>(); _unmodifiedValue.CopyFrom(this); _existingNames = existingNames; }
public void Edit(IEnumerable <string> existingNames) { _isAdd = false; Title = $"Editing \"{Name}\""; _existingNames = existingNames.Where(t => !string.Equals(t, Name, StringComparison.OrdinalIgnoreCase)).ToList(); _fieldsChanged = false; InitPredefinedFieldValues(); ResetFieldValuesForAllBuffers(); // Save unmodified properties. _unmodifiedValue = Container.Resolve <TemplateDialogViewModel>(); _unmodifiedValue.CopyFrom(this); }