Gorgon
Show / Hide Table of Contents

Interface IEditorContent

Common interface for editor content view models.

Inherited Members
IViewModel.WaitPanelActivated
IViewModel.WaitPanelDeactivated
IViewModel.ProgressUpdated
IViewModel.ProgressDeactivated
IViewModel.NotifyPropertyChanged(string)
IViewModel.NotifyPropertyChanging(string)
IViewModel.NotifyAllPropertiesChanging()
IViewModel.NotifyAllPropertiesChanged()
IViewModel.Load()
IViewModel.Unload()
INotifyPropertyChanged.PropertyChanged
INotifyPropertyChanging.PropertyChanging
Namespace: Gorgon.Editor.UI
Assembly: Gorgon.Editor.API.dll
Syntax
public interface IEditorContent : IViewModel, INotifyPropertyChanged, INotifyPropertyChanging

Properties

| Edit this page View Source

Clipboard

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.

| Edit this page View Source

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).

| Edit this page View Source

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.

| Edit this page View Source

ContentState

Property to set or return the current content state.

Declaration
ContentState ContentState { get; set; }
Property Value
Type Description
ContentState
| Edit this page View Source

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".

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author