Class LayoutEditorViewModel
A class containing the logic for the Layout Editor
Implements
Inherited Members
Namespace: Phoenix.Aruba.Layouts
Assembly: Phoenix.Plugin.Aruba.dll
Syntax
public class LayoutEditorViewModel : BindableBase, INotifyPropertyChanged
Constructors
View SourceLayoutEditorViewModel(Dispatcher, ITemplateExplorerViewModel)
Initializes a new instance of the LayoutEditorViewModel class.
Declaration
public LayoutEditorViewModel(Dispatcher dispatcher, ITemplateExplorerViewModel templateExplorerVM)
Parameters
Type | Name | Description |
---|---|---|
Dispatcher | dispatcher | The dispatcher from the BE view model. |
ITemplateExplorerViewModel | templateExplorerVM | The template explorer view model. |
Properties
View SourceHasUnsavedChanges
Gets or sets a value indicating whether the layout has unsaved changes.
Declaration
public bool HasUnsavedChanges { get; set; }
Property Value
Type | Description |
---|---|
bool |
Sections
Gets the sections in this editor.
Declaration
public ObservableCollection<LayoutSectionViewModel> Sections { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<LayoutSectionViewModel> |
SelectedSection
Gets or sets the currently selected section.
Declaration
public LayoutSectionViewModel SelectedSection { get; set; }
Property Value
Type | Description |
---|---|
LayoutSectionViewModel |
SharedInfo
Gets or sets the shared info.
Declaration
public ViewModelSharedInfo SharedInfo { get; set; }
Property Value
Type | Description |
---|---|
ViewModelSharedInfo |
Methods
View SourceAddColumnToSelectedSection()
Adds a column to the currently selected section.
Declaration
public void AddColumnToSelectedSection()
AddFieldToColumn()
Adds a field to the currently selected section and column.
Declaration
public void AddFieldToColumn()
AddHeaderToColumn()
Adds a field to the currently selected section and column.
Declaration
public void AddHeaderToColumn()
AddSection(bool, string)
Adds a section to the editor.
Declaration
public void AddSection(bool isAttachmentSection = false, string attachmentSectionHeader = null)
Parameters
Type | Name | Description |
---|---|---|
bool | isAttachmentSection | Whether this section should contain attachments. |
string | attachmentSectionHeader | The header for this section if it contains attachments. |
InitializeAsync()
Initializes the view model asynchronously.
Declaration
public Task InitializeAsync()
Returns
Type | Description |
---|---|
Task | A task. |
LoadLayout()
Declaration
public Task LoadLayout()
Returns
Type | Description |
---|---|
Task |
MoveSectionItemToColumn(int)
Moves the selected item to the specified column.
Declaration
public void MoveSectionItemToColumn(int indexOfColumnToMoveTo)
Parameters
Type | Name | Description |
---|---|---|
int | indexOfColumnToMoveTo | The index of the column to move the item to. |
MoveSelectedItemDown()
Moves the selected item down.
Declaration
public void MoveSelectedItemDown()
MoveSelectedItemUp()
Moves the selected item up.
Declaration
public void MoveSelectedItemUp()
ProcessSelectionChange(LayoutSectionViewModel, bool)
Processes a selection change between sections.
Declaration
public void ProcessSelectionChange(LayoutSectionViewModel selectedSection, bool hasSelectionPropertyChange = false)
Parameters
Type | Name | Description |
---|---|---|
LayoutSectionViewModel | selectedSection | The newly selected section. |
bool | hasSelectionPropertyChange | Is this being called because of a property change. |
RemoveColumnItem()
Removes the currently selected item.
Declaration
public void RemoveColumnItem()
RemoveSection(LayoutSectionViewModel)
Removes a section from the editor.
Declaration
public void RemoveSection(LayoutSectionViewModel sectionToRemove)
Parameters
Type | Name | Description |
---|---|---|
LayoutSectionViewModel | sectionToRemove | The section to remove. |
TrySaveLayoutFileAsync()
Attempts to save the current layout file.
Declaration
public Task TrySaveLayoutFileAsync()
Returns
Type | Description |
---|---|
Task | A task. |
Unintialize()
Uninitialize the Layout Editor View Model
Declaration
public void Unintialize()
UnintializeAsync()
Uninitialize the Layout Editor View Model
Declaration
public Task UnintializeAsync()
Returns
Type | Description |
---|---|
Task | A Task. |