Search Framework:
ChildWindow
Namespace: WealthLab.WPF
Parent: UserControl

The ChildWindow class derives from WPF UserControl and provides the integration points required for a custom window to participate in WealthLab 9's multiple document interface. Client Extensions typically derive their custom windows from ChildWindow so WealthLab can manage activation, workspace persistence, chart integration, editor integration, Expert Mode, and window lifecycle events.

Members
AllowWindowClose
public virtual bool AllowWindowClose()

Override this method to determine whether WealthLab is permitted to close the ChildWindow. Return false to cancel the close operation, for example when the user has unsaved work and elects not to discard it. The default implementation returns true.


Chart
public virtual IChart Chart

If the ChildWindow contains a chart, override this property to return the corresponding IChart instance. WealthLab uses this interface to interact with the chart. The default value is null.


ChartMouseBarChanged
public virtual void ChartMouseBarChanged(BarHistory bars, int idx)

Call or override this method when the chart mouse moves to a different bar. The default implementation informs the hosting WealthLab Main Window of the BarHistory and bar index so other UI elements can respond to the change.


ChartThisSymbol
public virtual void ChartThisSymbol(string symbol, DataSet ds)

WealthLab calls this method when the ChildWindow is active and a symbol should be charted. The default implementation calls Chart.ChartThisSymbol when the Chart property is not null.


Cleanup
public virtual void Cleanup()

Override this method to perform cleanup when the ChildWindow closes, such as releasing resources or unregistering event handlers. WealthLab calls Cleanup as part of its closing process.


Editor
public virtual object Editor

If the ChildWindow contains a text editor, override this property to return the editor instance. WealthLab uses this value to apply its Editor Preferences when the ChildWindow is activated. The default value is null.


HelpToken
public virtual string HelpToken

Returns the token of the WealthLab Help page associated with the ChildWindow. The default implementation returns Token.


Initialize
public virtual void Initialize()

Override this method to perform initialization after the ChildWindow has been associated with its WealthLab host. Unlike the constructor, MyClientHost is available when Initialize is called.


IsChartVisible
public virtual bool IsChartVisible

Returns whether the chart represented by Chart is currently visible in the ChildWindow. The default value is true.


IsEditorVisible
public virtual bool IsEditorVisible

Returns whether the editor represented by Editor is currently visible. WealthLab uses this information when determining whether Editor-related commands should be enabled. The default value is false.


JumpToViewPage
public virtual string JumpToViewPage

Returns the name of the page that WealthLab should display in the Main Window's left navigation panel when the ChildWindow is first opened. Return an empty string to leave the current page unchanged. Typical values include "DataSets", "Indicators", "Strategies", "BuildingBlocks", and "QuickRef".


MyClientHost
public IWLClientHost MyClientHost

Gets or sets the IWLClientHost associated with the WealthLab Main Window hosting this ChildWindow. Client Extensions can use this interface to interact with the parent WealthLab window.


MyMDIChild
public MDIChild MyMDIChild

Gets or sets the MDIChild window that contains this ChildWindow. When assigned, ChildWindow registers for activation, deactivation, closing, and title-change events, sizes the MDI window relative to the WealthLab container, creates the corresponding Window menu entry, and applies the current Expert Mode state.


ProcessClosing
public void ProcessClosing()

Performs WealthLab's ChildWindow shutdown processing. It removes the corresponding Window menu entry, unregisters MDI event handlers, clears MyMDIChild, and calls Cleanup.


ProcessDeactivation
public virtual void ProcessDeactivation()

Override this method to perform processing when the ChildWindow loses focus. WealthLab calls it when the containing MDI window is deactivated.


SetExpertMode
public virtual void SetExpertMode(bool expertModeOn)

WealthLab calls this method when the ChildWindow is associated with its MDI parent to indicate whether WealthLab Expert Mode is enabled. Override it to hide or simplify explanatory UI when expertModeOn is true.


StrategyParameters
public virtual ParameterList StrategyParameters

If the ChildWindow is associated with Strategy Parameters, override this property to return the applicable ParameterList. The default value is null.


Token
public virtual string Token

Returns a string identifying the type of ChildWindow. Client Extensions should override this property with a unique token, particularly when participating in Workspace restoration. The default value is an empty string.


UpdateStrategyParameters
public virtual void UpdateStrategyParameters(ParameterList pl, bool autoRun, Parameter pChanged)

WealthLab calls this method when Strategy Parameter sliders associated with the ChildWindow are changed. Override it to respond to the updated ParameterList, the autoRun state, and the specific Parameter that changed.


WindowID
public string WindowID

Gets or sets a unique identifier for the specific ChildWindow instance. WealthLab can use this value to retrieve a particular open window instance.


WorkspaceString
public virtual string WorkspaceString

Override this property's getter and setter to participate in WealthLab Workspace persistence. The getter should return a string containing the state required to restore the ChildWindow. The setter should parse a previously saved value and restore that state. The default implementation returns an empty string and ignores assigned values.