Skip to main content
Namespace: Phoenix.ComponentPlugInSDK.ViewModels
Assembly: Phoenix.ComponentPlugInSDK.dll
This Class serves as a base class for CAM PlugIn ViewModels. It has built-in commands for saving and managing the model state.

Type Parameters

MODEL_TYPE The Type of the model that the viewModel is presenting.

Inheritance

object ← AbstractPlugInViewModel<MODEL_TYPE>

Implements

IPlugInViewModel, INotifyPropertyChanged

Inherited Members

object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Constructors

AbstractPlugInViewModel(MODEL_TYPE, ILogger, string, Func<MODEL_TYPE, Task>, Action, Action<Exception>, Uri) Constructor.

Fields

_logger The logger to use. _showErrorAction Displays an error message to the user, in a way defined by the view.

Properties

BuilderName The Name of the Builder, this will be used to build the WindowTitle and titles of other dialogs. ExternalMetadata The ExternalMetadata, if any, associated with the pacz HasStatus If there is any status set. Will be true if StatusMessage is non-null OR StatusColor is not System.Windows.Media.Colors.Transparent InputVariables List of input variables in the component. IsBusy Whether the view model is currently busy. IsDirty Whether there are any unsaved changes in the editor. IsNotReadOnly If the pacz is NOT read only, this is true when the pacz is writable IsReadOnly If the pacz is read only OkCommand Command to apply changes and close the dialog. OutputVariables List of output variables in the component. SaveCommand Command to perform an apply operation. StatusColor The color to use to indicate the status. System.Windows.Media.Colors.Transparent is used to indicate not set. StatusMessage The status message to display WindowIcon The icon of the view’s window. If null, the default Windows icon will be used. WindowTitle The Title of the View’s Window, should indicate state(IsDirty, IsBusy)

Methods

CloneInputVariablesFrom(IEnumerable<IRuntimeVariable>) Sets Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.InputVariables based on the passed in values CloneOutputVariablesFrom(IEnumerable<IRuntimeVariable>) Sets Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.OutputVariables based on the passed in values GetVariablesAsPHXVariable(VariableValueScope) Retrieves the Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.InputVariables and Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.OutputVariables converted to an enumerable of PHXVariable objects. MoveInputVariablesFrom(IEnumerable<IRuntimeVariable>) Sets Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.InputVariables based on the passed in values MoveOutputVariablesFrom(IEnumerable<IRuntimeVariable>) Sets Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.OutputVariables based on the passed in values OnPropertyChanged(string) Raises the PropertyChanged Event for the calling member SaveAsync() Saves the current state of the component to the Pacz. SetStatus(string, Color) Sets the status parameters. If the message is null and the color is the default, System.Windows.Media.Colors.Transparent, then Phoenix.ComponentPlugInSDK.ViewModels.AbstractPlugInViewModel1.HasStatus` will return false. SetVariablesAsPHXVariable(IEnumerable<PHXVariable>) Reads a list of PHXVariable objects and replaces the Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.InputVariables and Phoenix.ComponentPlugInSDK.ViewModels.IPlugInViewModel.OutputVariables parameters based on this content, converted to IRuntimeVariables. _handleError(Exception) Function to use to handle errors in command executions _onInputsChanged() This function will be called when the Phoenix.ComponentPlugInSDK.ViewModels.AbstractPlugInViewModel1.InputVariables` change to allow derived classes to notify the UI. _onOutputsChanged() This function will be called when the Phoenix.ComponentPlugInSDK.ViewModels.AbstractPlugInViewModel1.InputVariables` change to allow derived classes to notify the UI. PropertyChanged An INotifyPropertyChanged Event Handler that will handle the PropertyChanged event raised when a property is changed.