Class ModelToolWindowController
An base controller for any view that is purely hosted within a tool window (see https://web.lemonedge.com/help/tool-windows/) and works against a ToolWindowItem
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
public abstract class ModelToolWindowController : ModelViewController, IModelViewController, IHasToggleStatus, IDisposable
Constructors
ModelToolWindowController(IModelView)
Creates a new ModelToolWindowController
Declaration
public ModelToolWindowController(IModelView view)
Parameters
Type | Name | Description |
---|---|---|
IModelView | view | The view this controller works with |
Properties
CurrentDisplayedLayout
The current active layout this tool window is operating against
Declaration
protected IModelLayoutDisplayer CurrentDisplayedLayout { get; }
Property Value
Type | Description |
---|---|
IModelLayoutDisplayer |
CurrentToolWindowItem
The tool window item this layout is displaying
Declaration
protected ToolWindowItem CurrentToolWindowItem { get; }
Property Value
Type | Description |
---|---|
ToolWindowItem |
IsToggled
If toggled, indicates this view is working against the selected item wthin a grid of the currently active layout displayer. Otherwise it is just working against the main item of the layout displayer itself.
Declaration
public bool IsToggled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SelectedItemForSubViews
The currently active IModelLayoutDisplayer main displayed item, or the selected grid item within it
Declaration
public override object SelectedItemForSubViews { get; }
Property Value
Type | Description |
---|---|
System.Object |
Overrides
TrackLayoutTabChanging
Indicates this view needs to track the current active tab of the layout this tool window is working against.
This is required for view based tool windows such as the LayoutDesigner
The default value is false
Declaration
protected virtual bool TrackLayoutTabChanging { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
TrackViewSelectedItems
Indicates this view should have a command that allows the user to switch between the tool window working against the item of the currently active IModelLayoutDisplayer, or the selected grid item within it
The default value is false
Declaration
protected virtual bool TrackViewSelectedItems { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddHandlers(IModelLayoutDisplayer)
Adds the handlers for tracking TrackLayoutTabChanging and TrackViewSelectedItems options
Declaration
protected virtual void AddHandlers(IModelLayoutDisplayer item)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutDisplayer | item | The currently active layout this tool window is working against |
DisplayItem(Object)
Tracks any required events on the active layout specified from TrackViewSelectedItems and TrackLayoutTabChanging
Declaration
public override Task DisplayItem(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The current ToolWindowItem being displayed against this view |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
DisplayToolWindow(Object)
Must be implemented by the inheriting controller to display the associated view
Declaration
public abstract Task DisplayToolWindow(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The current item against the active layout, or selected grid item within the layout, this tool window is working against |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
DisplayUI()
Calls DisplayToolWindow(Object) with the appropriate current active layout item, or grid item within the active layout (if TrackViewSelectedItems has been toggled by the yser)
Declaration
public override sealed Task DisplayUI()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
Overrides
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
InitCommands(IList<ViewCommand>)
If TrackViewSelectedItems is true this adds a tool window command that toggles between this view working against the item of the currently active IModelLayoutDisplayer, or the selected grid item within it
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<ViewCommand> | commands | The current list of commands for this view |
Overrides
OnTabChanged(ModelLayoutDisplayerController, LayoutTabChangedEventArgs)
Is called when the current tab against the currently active layout has been changed by the user
Only called if TrackLayoutTabChanging is true
Declaration
protected virtual void OnTabChanged(ModelLayoutDisplayerController source, LayoutTabChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ModelLayoutDisplayerController | source | The active layout displayer this tool window view is working against |
LayoutTabChangedEventArgs | e | The arguments of the tab that has changed |
OnViewItemChanged(ModelLayoutDisplayerController, LayoutSubViewItemChangedEventArgs)
Is called when the currently active layout displayer has a view within it that has selected a different item to work against (typically a IBaseGrid view)
Only called if TrackViewSelectedItems is true
Declaration
protected virtual void OnViewItemChanged(ModelLayoutDisplayerController source, LayoutSubViewItemChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ModelLayoutDisplayerController | source | The owning layout displayer this view is contained within |
LayoutSubViewItemChangedEventArgs | e | The sub item changed event args detailing the newly selected item within a view |
RemoveHandlers(IModelLayoutDisplayer)
Removes the handlers for tracking TrackLayoutTabChanging and TrackViewSelectedItems options
Declaration
protected virtual void RemoveHandlers(IModelLayoutDisplayer item)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutDisplayer | item | The currently active layout this tool window is working against |
ToggleViewingViewSelectedItems()
Toggles between this view working against the current main item of the current active layout and the selected item within a grid within the layout itself
Declaration
public void ToggleViewingViewSelectedItems()
ViewSelectedItemsUpdate(Boolean)
Called whenever the user toggles between viewing the selected items within a grid row, and the item for the layout itself
Declaration
public virtual void ViewSelectedItemsUpdate(bool viewingSelectedItem)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | viewingSelectedItem | Indicates if the toolwindow is viewing selected items in a grid or not |
Events
ToggleChanged
Indicates the user has toggled between this view working against the current main item of the current active layout and the selected item within a grid within the layout itself
Declaration
public event EventHandler<EventArgs> ToggleChanged
Event Type
Type | Description |
---|---|
System.EventHandler<System.EventArgs> |