Interface IEditorContent
Common interface for editor content view models.
Inherited Members
Namespace: Gorgon.Editor.UI
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IEditorContent : IViewModel, INotifyPropertyChanged, INotifyPropertyChanging
Properties
| Edit this page View SourceClipboard
Property to return the clipboard handler for this view model.
Declaration
IClipboardHandler Clipboard { get; }
Property Value
Type | Description |
---|---|
IClipboardHandler |
Remarks
This gives access to the application clipboard functionality to copy, cut and paste data. If this is assigned, then your view should have some means to execute the required commands for the copy, cut and paste operations.
important
The application clipboard is not the same as the Windows clipboard. Data copied to the application clipboard is not accessible by other applications.
CloseContentCommand
Property to return the command used when the content is about to be closed.
Declaration
IEditorAsyncCommand<CloseContentArgs> CloseContentCommand { get; }
Property Value
Type | Description |
---|---|
IEditorAsyncCommand<CloseContentArgs> |
Remarks
This command will be executed when the user shuts down the content via some UI element (e.g. the 'X' in a window).
CommandContext
Property to set or return the current context for commands from this content.
Declaration
IEditorContext CommandContext { get; set; }
Property Value
Type | Description |
---|---|
IEditorContext |
Remarks
This is used in UI interactions where the context of the operations may change depending on state. An example would be a context for an MS Office ribbon control, where activating a tool would then show a new set of commands that were previously hidden. These commands would appear under a context heading on the ribbon.
If the UI does not support contexts, then this property would be ignored.
ContentState
Property to set or return the current content state.
Declaration
ContentState ContentState { get; set; }
Property Value
Type | Description |
---|---|
ContentState |
ContentType
Property to return the type of content.
Declaration
string ContentType { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
The content type is a user defined string that indicates what the data for the content represents. For example, for an image editor, this could return "Image".
File
Property to return the content file.
Declaration
IContentFile File { get; }
Property Value
Type | Description |
---|---|
IContentFile |
Remarks
This is the file that contains the content data. Useful in cases where the path for the file is required, or other file properties are needed.
FilesAreSelected
Property to return whether there are files selected by the user in project file system.
Declaration
bool FilesAreSelected { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This property is useful for enabling or disabling UI elements based on file selection.
SaveContentCommand
Property to set or return the command used to save the content.
Declaration
IEditorAsyncCommand<SaveReason> SaveContentCommand { get; set; }
Property Value
Type | Description |
---|---|
IEditorAsyncCommand<SaveReason> |
Remarks
This command will be executed when the user wants to persist the content data back to the project file system. Developers must assign a command here in order to persist the data back to the file system.