Class OverviewScreenBase<TModel>
- Namespace
- Dynamicweb.CoreUI.Screens
- Assembly
- Dynamicweb.CoreUI.dll
Base class for overview (dashboard) screens that present a model's data as a collection of widgets in a tabbed layout.
public abstract class OverviewScreenBase<TModel> : ScreenBase<TModel> where TModel : DataViewModelBase
Type Parameters
TModelThe data view model type whose data is presented on the screen.
- Inheritance
-
ScreenBase<TModel>OverviewScreenBase<TModel>
- Inherited Members
Remarks
Use OverviewScreenBase<TModel> when the goal is a read-oriented summary view composed of independent widgets such as charts, lists, or key metrics. For edit-oriented forms use PromptScreenBase<TModel> instead.
Subclasses must implement GetScreenName() and BuildOverviewScreen(). Optionally override GetScreenActions() to supply context action groups, GetBackAction() to customise the back/cancel navigation, and GetLanguageSelectorOptions(TModel) to enable a language switcher in the toolbar.
Properties
ShowCloseAction
Gets or sets whether a Back button is rendered in the screen toolbar. When true, the button triggers GetBackAction() or falls back to Default. Defaults to false.
protected bool ShowCloseAction { get; set; }
Property Value
Methods
AddComponent(UiComponentBase?, string?, GroupWidth, Icon?, ContextMenu?, string?)
Adds a Widget to the default tab of the overview screen.
protected void AddComponent(UiComponentBase? component, string? heading = null, Group.GroupWidth width = GroupWidth.Col_6, Icon? icon = null, ContextMenu? contextMenu = null, string? color = null)
Parameters
componentUiComponentBaseThe content to display inside the widget. Null is silently ignored.
headingstringThe widget heading shown to the user.
widthGroup.GroupWidthThe grid column width of the widget container.
iconIconOptional icon rendered in the widget header.
contextMenuContextMenuOptional context menu attached to the widget. Suppressed when all action groups are empty.
colorstringOptional highlight colour applied to the widget icon.
AddComponent(UiComponentBase?, string?, string?, GroupWidth, Icon?, ContextMenu?, string?)
Adds a Widget to the default tab of the overview screen, with an explanation shown below the widget's group header.
protected void AddComponent(UiComponentBase? component, string? heading, string? explanation, Group.GroupWidth width = GroupWidth.Col_6, Icon? icon = null, ContextMenu? contextMenu = null, string? color = null)
Parameters
componentUiComponentBaseThe content to display inside the widget. Null is silently ignored.
headingstringThe widget heading shown to the user.
explanationstringOptional explanation/help text shown below the widget's group header.
widthGroup.GroupWidthThe grid column width of the widget container.
iconIconOptional icon rendered in the widget header.
contextMenuContextMenuOptional context menu attached to the widget. Suppressed when all action groups are empty.
colorstringOptional highlight colour applied to the widget icon.
AddComponent(string?, UiComponentBase?, string?, GroupWidth, Icon?, ContextMenu?, string?)
Adds a Widget to the specified tab of the overview screen.
protected void AddComponent(string? tabName, UiComponentBase? component, string? heading = null, Group.GroupWidth width = GroupWidth.Col_6, Icon? icon = null, ContextMenu? contextMenu = null, string? color = null)
Parameters
tabNamestringThe name of the tab that receives the widget. Pass null to use the default tab.
componentUiComponentBaseThe content to display inside the widget. Null is silently ignored.
headingstringThe widget heading shown to the user.
widthGroup.GroupWidthThe grid column width of the widget container.
iconIconOptional icon rendered in the widget header.
contextMenuContextMenuOptional context menu attached to the widget. Suppressed when all action groups are empty.
colorstringOptional highlight colour applied to the widget icon.
AddComponent(string?, UiComponentBase?, string?, string?, GroupWidth, Icon?, ContextMenu?, string?)
Adds a Widget to the specified tab of the overview screen, with an explanation shown below the widget's group header.
protected void AddComponent(string? tabName, UiComponentBase? component, string? heading, string? explanation, Group.GroupWidth width = GroupWidth.Col_6, Icon? icon = null, ContextMenu? contextMenu = null, string? color = null)
Parameters
tabNamestringThe name of the tab that receives the widget. Pass null to use the default tab.
componentUiComponentBaseThe content to display inside the widget. Null is silently ignored.
headingstringThe widget heading shown to the user.
explanationstringOptional explanation/help text shown below the widget's group header.
widthGroup.GroupWidthThe grid column width of the widget container.
iconIconOptional icon rendered in the widget header.
contextMenuContextMenuOptional context menu attached to the widget. Suppressed when all action groups are empty.
colorstringOptional highlight colour applied to the widget icon.
AddWidget(Widget, GroupWidth)
Adds an already-constructed Widget to the default tab of the overview screen.
protected void AddWidget(Widget widget, Group.GroupWidth width = GroupWidth.Col_6)
Parameters
widgetWidgetThe widget to add.
widthGroup.GroupWidthThe grid column width of the widget container.
AddWidget(string?, Widget, GroupWidth)
Adds an already-constructed Widget to the specified tab of the overview screen.
protected void AddWidget(string? tabName, Widget widget, Group.GroupWidth width = GroupWidth.Col_6)
Parameters
tabNamestringThe name of the tab that receives the widget. Pass null to use the default tab.
widgetWidgetThe widget to add.
widthGroup.GroupWidthThe grid column width of the widget container.
BuildOverviewScreen()
Constructs the screen content by calling AddComponent(UiComponentBase?, string?, GroupWidth, Icon?, ContextMenu?, string?) or AddWidget(Widget, GroupWidth) for each widget to display. Called once during GetDefinition().
protected abstract void BuildOverviewScreen()
GetBackAction()
Returns the action to execute when the user presses the Back button.
protected virtual ActionBase? GetBackAction()
Returns
- ActionBase
A custom ActionBase for back navigation, or null to use Default.
GetDefinitionInternal()
Builds and returns the raw component tree for this screen.
protected override sealed UiComponentBase GetDefinitionInternal()
Returns
Remarks
Implement this method in every concrete screen class. The result is post-processed by GetDefinition() (injectors, trimming, preset actions) before being returned to the framework.
GetLanguageSelectorOptions(TModel)
Returns the action nodes used to populate the language selector in the screen toolbar.
protected virtual IEnumerable<ActionNode>? GetLanguageSelectorOptions(TModel model)
Parameters
modelTModelThe current screen model.
Returns
- IEnumerable<ActionNode>
One ActionNode per language option, where the currently active language has Disabled set to true. Return null or fewer than two nodes to suppress the selector entirely.
GetScreenActions()
Returns the context action groups rendered in the screen's toolbar.
protected virtual IEnumerable<ActionGroup>? GetScreenActions()
Returns
- IEnumerable<ActionGroup>
A sequence of ActionGroup instances, or null when no actions are required.
GetScreenName()
Returns the display name shown in the screen header.
protected abstract string GetScreenName()
Returns
- string
A non-empty string identifying this screen to the user.
SetInfobar(InfoBar?)
Sets or clears the informational banner displayed at the top of the overview screen.
protected void SetInfobar(InfoBar? bar)