Class TemplateTreeItemViewModel
A class containing the logic for a Template Tree Item. See also TreeItemViewModelBase.
Implements
Inherited Members
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class TemplateTreeItemViewModel : TreeItemViewModelBase, INotifyPropertyChanged
Constructors
View SourceTemplateTreeItemViewModel(TemplateViewModel)
Initializes a new instance of the TemplateTreeItemViewModel class.
Declaration
public TemplateTreeItemViewModel(TemplateViewModel templateViewModel)
Parameters
Type | Name | Description |
---|---|---|
TemplateViewModel | templateViewModel | The template view model associated with this item. |
TemplateTreeItemViewModel(TreeItemViewModelBase)
Initializes a new instance of the TemplateTreeItemViewModel class.
Declaration
public TemplateTreeItemViewModel(TreeItemViewModelBase parentItemVM)
Parameters
Type | Name | Description |
---|---|---|
TreeItemViewModelBase | parentItemVM | The parent of this tree item. |
Properties
View SourceChildIsDirty
Gets a value indicating whether any of this item's children are dirty.
Declaration
public bool ChildIsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
ChildrenTemplateVMs
Gets the Children as an enumerable of Template View Models.
Declaration
public IEnumerable<TemplateViewModel> ChildrenTemplateVMs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TemplateViewModel> |
ChildrenTreeItemVMs
Gets the Children as an enumerable of Tree Item View Models.
Declaration
public IEnumerable<TemplateTreeItemViewModel> ChildrenTreeItemVMs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TemplateTreeItemViewModel> |
IsExpanded
Gets or sets a value indicating whether the item is expanded.
Declaration
public bool IsExpanded { get; set; }
Property Value
Type | Description |
---|---|
bool |
TemplateViewModel
Gets the template view model associated with this tree item.
Declaration
public TemplateViewModel TemplateViewModel { get; }
Property Value
Type | Description |
---|---|
TemplateViewModel |
Methods
View SourceChangeParent(bool, bool, TemplateViewModel, Action<TemplateDefinition>)
Change the item's parent.
Declaration
public void ChangeParent(bool makeRoot, bool moveChildren, TemplateViewModel newParent, Action<TemplateDefinition> updateFunc)
Parameters
Type | Name | Description |
---|---|---|
bool | makeRoot | Whether to set the parent to the root. |
bool | moveChildren | Whether to move the item's children with it. |
TemplateViewModel | newParent | The new parent. |
Action<TemplateDefinition> | updateFunc | The function to update the item. |
ExpandUpTheTree()
Walks up the tree and expands each parent.
Declaration
public void ExpandUpTheTree()
GetAllGuids()
Recursive function to get the Guid(s) of the current TemplateTreeItemViewModel object and all of it's children.
Declaration
public List<Guid> GetAllGuids()
Returns
Type | Description |
---|---|
List<Guid> | Returns a list of Guid. |
GetAllTreeItemVMs()
Recursive function to get the TemplateTreeItemViewModel(s) of the current object and all of it's children.
Declaration
public List<TemplateTreeItemViewModel> GetAllTreeItemVMs()
Returns
Type | Description |
---|---|
List<TemplateTreeItemViewModel> | Returns a list of TemplateTreeItemViewModel. |
PrepareForDeletion(Action<TemplateDefinition>)
Update all hierarchy links in preparation for deletion.
Declaration
public ObservableCollection<TreeItemViewModelBase> PrepareForDeletion(Action<TemplateDefinition> updateFunc)
Parameters
Type | Name | Description |
---|---|---|
Action<TemplateDefinition> | updateFunc | The update function to use. |
Returns
Type | Description |
---|---|
ObservableCollection<TreeItemViewModelBase> | Returns children of collection if parent was root, otherwise null. |
PrepareForParentChange()
Get the item ready for a their parent to change.
Declaration
public void PrepareForParentChange()
PrepareForParentUpdate()
Removes any fields that are from the parent template (except those that were overridden) in preparation for an update from a parent. Recurse through children as well.
Declaration
public void PrepareForParentUpdate()
ProcessParentRename(Guid)
Update parent template name in the template view model and any fields from that parent.
Declaration
public void ProcessParentRename(Guid renamedParentId)
Parameters
Type | Name | Description |
---|---|---|
Guid | renamedParentId | The id of the parent that was renamed. |
SaveQueryToChildrenIfApplicable(DuplicateCheckQueryDefinition)
Applies a DuplicateCheckQueryDefinition to the children of this template if the child doesn't have a query saved, or whose definition is not unique from the parent's. If the child's saved query definition is unique, its DuplicateCheckQueryDefinition will not be overriden.
Declaration
public void SaveQueryToChildrenIfApplicable(DuplicateCheckQueryDefinition newDefinition)
Parameters
Type | Name | Description |
---|---|---|
DuplicateCheckQueryDefinition | newDefinition | The new query definition to apply to children. |
UpdateTemplate(Action<TemplateDefinition>)
Update the template definition and its children recursively.
Declaration
public void UpdateTemplate(Action<TemplateDefinition> updateFunc)
Parameters
Type | Name | Description |
---|---|---|
Action<TemplateDefinition> | updateFunc | The update function to use. |