Class CanvasViewModel
The view model for a canvas display of a quality pass.
Inheritance
Inherited Members
Namespace: Phoenix.BotBrain.Overmind
Assembly: Phoenix.Plugin.BotBrain.Overmind.dll
Syntax
public class CanvasViewModel : AutomationViewModelBase<CanvasView>, INotifyPropertyChanged, IDisposable
Constructors
View SourceCanvasViewModel(CanvasView, QualityPassViewModel, IServiceProvider)
Initializes a new instance of the CanvasViewModel class.
Declaration
public CanvasViewModel(CanvasView view, QualityPassViewModel qualityPass, IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
CanvasView | view | The canvas view. |
QualityPassViewModel | qualityPass | The quality pass view model. |
IServiceProvider | services | The services provider. |
Properties
View SourceCanvasHeight
Gets a value indicating the height of the canvas
Declaration
public double CanvasHeight { get; }
Property Value
Type | Description |
---|---|
double |
CanvasObjectScalerX
Gets a value indicating the X scale to apply to objects Using 1920x1080 as default design and scaling from there
Declaration
public double CanvasObjectScalerX { get; }
Property Value
Type | Description |
---|---|
double |
CanvasObjectScalerY
Gets a value indicating the Y scale to apply to objects Using 1920x1080 as default design and scaling from there
Declaration
public double CanvasObjectScalerY { get; }
Property Value
Type | Description |
---|---|
double |
CanvasWidth
Gets a value indicating the width of the canvas
Declaration
public double CanvasWidth { get; }
Property Value
Type | Description |
---|---|
double |
ClearActiveInfoCommand
Gets the command to clear the active info displayed
Declaration
public DelegateCommand ClearActiveInfoCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand |
DisplayActiveInfoCommand
Gets the command to display information about the moused over object
Declaration
public DelegateCommand<CanvasObject> DisplayActiveInfoCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<CanvasObject> |
SelectedCanvasObject
Gets the selected canvas object.
Declaration
public object? SelectedCanvasObject { get; }
Property Value
Type | Description |
---|---|
object |
ShowActiveItemInfo
Gets a value indicating whether or not to display info on the moused over object
Declaration
public bool ShowActiveItemInfo { get; }
Property Value
Type | Description |
---|---|
bool |
UpdateSelectedItemCommand
Gets the command to update the selected scenario/role/etc from the canvas
Declaration
public DelegateCommand<CanvasObject> UpdateSelectedItemCommand { get; }
Property Value
Type | Description |
---|---|
DelegateCommand<CanvasObject> |
Methods
View SourceClearCanvas()
Clears the canvas of all children nodes
Declaration
public void ClearCanvas()
CreateOrGetOvermindNode()
Gets the main overmind node or creates it if necessary
Declaration
public CanvasObject CreateOrGetOvermindNode()
Returns
Type | Description |
---|---|
CanvasObject | The overmind node |
Dispose()
Removes all event handlers.
Declaration
public override void Dispose()
Overrides
View SourceRebuildCanvasThreeTier(IScenarioTreeItem?)
Main method to build out the canvas with all associated nodes
Declaration
public void RebuildCanvasThreeTier(IScenarioTreeItem? selectedNode)
Parameters
Type | Name | Description |
---|---|---|
IScenarioTreeItem | selectedNode | Item selected in the IScenarioTreeItem |
ResetAndRebuildCanvas()
Resizes and rebuilds the canvas and all objects in it
Declaration
public void ResetAndRebuildCanvas()
SetSelectedItem(IScenarioTreeItem?)
Update the canvas to highlight whatever item is selected in the IScenarioTreeItem
Declaration
public void SetSelectedItem(IScenarioTreeItem? selected)
Parameters
Type | Name | Description |
---|---|---|
IScenarioTreeItem | selected | The item in the IScenarioTreeItem that is selected |
UpdateCanvasSize(double, double)
Updates the sizes of the canvas to ensure we have enough room for all elements
Declaration
public void UpdateCanvasSize(double canvasActualWidth, double canvasActualHeight)
Parameters
Type | Name | Description |
---|---|---|
double | canvasActualWidth | The width to set the canvas width to |
double | canvasActualHeight | The height to set the canvas height to |
UpdateCanvasState(bool)
Updates the size changed timer and checks to see if the canvas needs to be rebuilt or cleared
Declaration
public void UpdateCanvasState(bool canvasShown)
Parameters
Type | Name | Description |
---|---|---|
bool | canvasShown | Boolean value indicating whether the canvas is in view |
UpdateTimerStatus(bool)
Updates the timer to either disable or enable it
Declaration
public void UpdateTimerStatus(bool status)
Parameters
Type | Name | Description |
---|---|---|
bool | status | Boolean to change the enabled status to |