Class TemplateExplorerViewModel
View model representing the list of templates.
Inherited Members
Namespace: Phoenix.Aruba
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class TemplateExplorerViewModel : BindableBase, INotifyPropertyChanged, ITemplateExplorerViewModel
Constructors
View SourceTemplateExplorerViewModel(Dispatcher)
Initializes a new instance of the TemplateExplorerViewModel class.
Declaration
public TemplateExplorerViewModel(Dispatcher dispatcher)
Parameters
Type | Name | Description |
---|---|---|
Dispatcher | dispatcher | The dispatcher. |
Properties
View SourceAccessLevel
Gets or sets the access level of the user to determine what commands they have access to.
Declaration
public AccessLevel AccessLevel { get; set; }
Property Value
Type | Description |
---|---|
AccessLevel |
AddQueryCommand
Gets a command for setting up the duplicate checking queries for a template.
Declaration
public ICommand AddQueryCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
AddTemplateAsFavoriteCommand
Gets a command to set a template as one of the user's favorites.
Declaration
public DelegateCommand<string> AddTemplateAsFavoriteCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
ApplyTemplateToCurrentBugCommand
Gets a command to apply the currently selected template to the bug that is currently open.
Declaration
public DelegateCommand<string> ApplyTemplateToCurrentBugCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
ChangeParentTemplateCommand
Gets a command for changing the parent of a template.
Declaration
public ICommand ChangeParentTemplateCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
ClearDefaultTemplateUserPreferenceCommand
Gets the command to clear default template user preference.
Declaration
public ICommand ClearDefaultTemplateUserPreferenceCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
CloneExistingBugVM
Gets the CloneExistingBugViewModel.
Declaration
public CloneExistingBugViewModel CloneExistingBugVM { get; }
Property Value
Type | Description |
---|---|
CloneExistingBugViewModel |
CloneTemplateCommand
Gets the command to clone a template.
Declaration
public DelegateCommand<string> CloneTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
DefaultTemplateUserPreference
Gets or sets the default template user preference.
Declaration
public TemplateViewModel DefaultTemplateUserPreference { get; set; }
Property Value
Type | Description |
---|---|
TemplateViewModel |
DeleteTemplateCommand
Gets the command to delete the template.
Declaration
public DelegateCommand<string> DeleteTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
EditTemplateCommand
Gets the command to edit the template.
Declaration
public DelegateCommand<string> EditTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
EventAggregator
Gets the Prism.Events.IEventAggregator to use to publish and subscribe to view-related events.
Declaration
public IEventAggregator EventAggregator { get; }
Property Value
Type | Description |
---|---|
IEventAggregator |
FavoriteTemplateVMs
Gets the favorite template view models.
Declaration
public ObservableCollection<TemplateViewModel> FavoriteTemplateVMs { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<TemplateViewModel> |
FavoritesIsActive
Gets or sets a value indicating whether the 'Favorites' tab is currently active (the selected tab).
Declaration
public bool FavoritesIsActive { get; set; }
Property Value
Type | Description |
---|---|
bool |
HasUnsavedChanges
Gets a value indicating whether any template has unsaved changes.
Declaration
public bool HasUnsavedChanges { get; }
Property Value
Type | Description |
---|---|
bool |
ImportTemplatesCommand
Gets the command to import templates from the file system.
Declaration
public DelegateCommand ImportTemplatesCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
IsSelectedTemplateValid
Gets a value indicating whether the selected template is valid.
Declaration
public bool IsSelectedTemplateValid { get; }
Property Value
Type | Description |
---|---|
bool |
MoveSelectedFavoriteDownCommand
Gets a command for moving the selected favorite down in the listed order.
Declaration
public ICommand MoveSelectedFavoriteDownCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
MoveSelectedFavoriteUpCommand
Gets a command for moving the selected favorite up in the listed order.
Declaration
public ICommand MoveSelectedFavoriteUpCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
MoveSelectedTemplateDownCommand
Gets a command for moving the selected template down in the listed order.
Declaration
public ICommand MoveSelectedTemplateDownCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
MoveSelectedTemplateUpCommand
Gets a command for moving the selected template up in the listed order.
Declaration
public ICommand MoveSelectedTemplateUpCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
NewBugCommand
Gets a command for creating a new bug.
Declaration
public DelegateCommand<string> NewBugCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
NewTemplateCommand
Gets a command for creating a new template.
Declaration
public DelegateCommand<string> NewTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
OnTemplateNameEditingChangedCommand
Gets a command for editing a template.
Declaration
public ICommand OnTemplateNameEditingChangedCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
OpenCloneExistingBugUICommand
Gets a command for opening the 'clone existing bug' pop-up.
Declaration
public ICommand OpenCloneExistingBugUICommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
PromptToChangeParentTemplateCommand
Gets a command for changing the parent of a template by launching a prompt for user to fill out.
Declaration
public DelegateCommand<string> PromptToChangeParentTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
RemoveTemplateAsFavoriteCommand
Gets a command to remove a template from a user's favorites.
Declaration
public DelegateCommand<string> RemoveTemplateAsFavoriteCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
RenameTemplateCommand
Gets a command for renaming a template.
Declaration
public ICommand RenameTemplateCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
ResetFavoritesToDefaultSortOrderCommand
Gets a command for resetting the favorites to their default sort order.
Declaration
public ICommand ResetFavoritesToDefaultSortOrderCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
ResetTemplatesToDefaultSortOrderCommand
Gets a command for resetting the templates to their default sort order.
Declaration
public ICommand ResetTemplatesToDefaultSortOrderCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
RevertTemplateCommand
Gets a command for reverting changes to a template.
Declaration
public DelegateCommand<string> RevertTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
SaveAllTemplatesCommand
Gets a command for saving all templates.
Declaration
public DelegateCommand<string> SaveAllTemplatesCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
SaveTemplateCommand
Gets a command for saving a template.
Declaration
public DelegateCommand<string> SaveTemplateCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<string> |
SelectedFavoriteTemplateNode
Gets or sets the selected node in the 'Favorites' tab.
Declaration
public TemplateViewModel SelectedFavoriteTemplateNode { get; set; }
Property Value
Type | Description |
---|---|
TemplateViewModel |
SelectedTemplateNode
Gets or sets the selected template node.
Declaration
public TemplateViewModel SelectedTemplateNode { get; set; }
Property Value
Type | Description |
---|---|
TemplateViewModel |
SelectedTreeItem
Gets or sets the selected tree item.
Declaration
public TemplateTreeItemViewModel SelectedTreeItem { get; set; }
Property Value
Type | Description |
---|---|
TemplateTreeItemViewModel |
SetDefaultTemplateUserPreferenceCommand
Gets a command to set a user preferred default template.
Declaration
public ICommand SetDefaultTemplateUserPreferenceCommand { get; }
Property Value
Type | Description |
---|---|
ICommand |
SharedInfo
Gets or sets the shared info view model.
Declaration
public ViewModelSharedInfo SharedInfo { get; set; }
Property Value
Type | Description |
---|---|
ViewModelSharedInfo |
TemplateExplorerCommands
Gets the containing object that holds all of the commands used by the view model.
Declaration
public TemplateExplorerCommands TemplateExplorerCommands { get; }
Property Value
Type | Description |
---|---|
TemplateExplorerCommands |
TemplateTreeItems
Gets the template tree items.
Declaration
public ObservableCollection<TemplateTreeItemViewModel> TemplateTreeItems { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<TemplateTreeItemViewModel> |
TemplateVMs
Gets the list of templates.
Declaration
public ObservableCollection<TemplateViewModel> TemplateVMs { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<TemplateViewModel> |
Methods
View SourceClearAllTemplates()
Clears out the templates and resets the selected template.
Declaration
public void ClearAllTemplates()
ClearAllTemplatesAsync()
Clears out the templates and resets the selected template.
Declaration
public Task ClearAllTemplatesAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
FlattenTemplateDefinitionData()
Flattens template definition data.
Declaration
public void FlattenTemplateDefinitionData()
MoveFavoritePosition(TemplateViewModel, TemplateViewModel)
Moves the specified favorite to, or as close to, the target's location in the collection.
Declaration
public void MoveFavoritePosition(TemplateViewModel source, TemplateViewModel target)
Parameters
Type | Name | Description |
---|---|---|
TemplateViewModel | source | The favorite to move. |
TemplateViewModel | target | The target to try and move the favorite to. |
MoveTemplatePosition(TemplateTreeItemViewModel, TemplateTreeItemViewModel)
Moves the specified template to, or as close to, the target's location in the collection.
Declaration
public void MoveTemplatePosition(TemplateTreeItemViewModel source, TemplateTreeItemViewModel target)
Parameters
Type | Name | Description |
---|---|---|
TemplateTreeItemViewModel | source | The template to move. |
TemplateTreeItemViewModel | target | The target to try and move the template to. |
OnSelectedItemChanged(object)
Called when a selected item is changed to refresh which commands are available.
Declaration
public void OnSelectedItemChanged(object item)
Parameters
Type | Name | Description |
---|---|---|
object | item | The selected item. |
ReadTemplateDefinitionsAsync()
Read all template definitions from the store location.
Declaration
public Task ReadTemplateDefinitionsAsync()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
SortTemplatesByUserPreferenceOrDefault(IList<TemplateViewModel>, UserPreferences)
Attempts to sort the templates by user preferences. Any templates not found in the user preferences will be sorted alphabetically.
Declaration
public static List<TemplateViewModel> SortTemplatesByUserPreferenceOrDefault(IList<TemplateViewModel> templatesToSort, UserPreferences userPreferences)
Parameters
Type | Name | Description |
---|---|---|
IList<TemplateViewModel> | templatesToSort | The list of templates to sort. |
UserPreferences | userPreferences | The preferences to use to sort the templates. |
Returns
Type | Description |
---|---|
List<TemplateViewModel> | A sorted list of templates. |
UninitializeAsync()
Declaration
public Task UninitializeAsync()
Returns
Type | Description |
---|---|
Task |
UpdateGlobalTemplateList()
Updates the global template list with the cached template tree items.
Declaration
public void UpdateGlobalTemplateList()