Search Framework:
ResultViewerBase
Namespace: WealthLab.WPF
Parent: UserControl
Descendants: VisualizerBase , OptimizationVisualizerBase , StrategyEvolverVisualizerBase

Derived from WPF UserControl, ResultViewerBase serves as the base class for WL9 Strategy and Optimization result viewers. It provides lifecycle hooks, tab presentation properties, and helper methods for configuring TeeChart controls and creating commonly used TeeChart series. public virtual void Initialize()

WL9 calls this method when the Viewer is first loaded into its host Strategy or Optimization window.
Override this method to perform one-time initialization required by the Viewer.
The default implementation does nothing.
Members
Cleanup
public virtual void Cleanup()

WL9 calls this method when the Viewer is about to be unloaded from its host window. Override this method to release resources, detach event handlers, or perform other cleanup required by the Viewer. The default implementation does nothing.


DisableGlyphReverse
public virtual bool DisableGlyphReverse

Determines whether WL9 should avoid reversing the Viewer glyph when using a dark theme. The default implementation returns false. Return true if the image specified by GlyphResource should be displayed unchanged in dark themes.


GlyphResource
public virtual string GlyphResource

Returns the embedded resource name of the image used for the Viewer's tab icon. For example, if your assembly is named SomeCompany.WealthLabUtils and contains an embedded resource named MyBitmap.png in an Images folder, the resource name would typically be:

Example Code
The default implementation returns an empty string.
### Initialize

ViewerName
public virtual string ViewerName

Returns the text displayed for the Viewer in its tab or Viewer list. The default implementation returns "Viewer Name".



TeeChart Related
ChartSetup
public void ChartSetup(TChart chart)

Applies standard WL9 formatting to the specified TeeChart WPF chart. The method applies the current WealthLab background theme when available, hides the chart header and top and bottom axis pens, positions the legend at the bottom, and configures standard font sizes and grid colors for the axes and legend. Call this method when using a TeeChart control in a custom ResultViewerBase-derived Viewer so its appearance is consistent with WL9.


CreateAreaSeries
public Area CreateAreaSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Area series associated with chart. The series is assigned the specified title and color, and its area and line borders are hidden. Area series are suitable for charts such as equity and drawdown curves.


CreateBarSeries
public Bar CreateBarSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Bar series associated with chart. The series is assigned the specified title and color, and its outline Pen is hidden. Bar series are suitable for charts such as profit distributions.


CreateCandleSeries
public Candle CreateCandleSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Candle series associated with chart. The series is assigned the specified title and color.


CreateErrorBarSeries
public ErrorBar CreateErrorBarSeries(
TChart chart,
Color color,
ErrorStyles errorStyle,
string title)

Creates and returns a TeeChart ErrorBar series associated with chart. The series is assigned the specified title, color, and errorStyle.


CreateFastLineSeries
public FastLine CreateFastLineSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart FastLine series associated with chart. The series is assigned the specified title and color. Its DrawAllPoints property is set to false, which can improve performance when rendering large numbers of data points.


CreateGanttSeries
public Gantt CreateGanttSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Gantt series associated with chart. The series is assigned the specified title and color. Gantt series can be used for visualizations such as Walk-Forward Optimization windows.


CreateLineSeries
public Steema.TeeChart.Styles.Line CreateLineSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Line series associated with chart. The series is assigned the specified title and color.


CreatePieSeries
public Pie CreatePieSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Pie series associated with chart. The series is assigned the specified title and color and its Circled property is enabled.


CreatePointsSeries
public Points CreatePointsSeries(
TChart chart,
Color color,
string title)

Creates and returns a TeeChart Points series associated with chart. The series is assigned the specified title and color. The points use circular markers with a horizontal and vertical size of 2. Their outline Pen is hidden, and the connecting line is disabled.


ResetChartZoom
public void ResetChartZoom(TChart chart)

Resets the specified TeeChart control to automatic axis scaling after the user has zoomed the chart. The method sets the Left, Bottom, and Right axes back to automatic scaling and then invalidates the chart so it is redrawn.