Table of Contents

Class ListScreenInjector<TScreen, TScreenModel, TRowModel>

Namespace
Dynamicweb.CoreUI.Screens
Assembly
Dynamicweb.CoreUI.dll

Base class for injecting custom cells and actions into a ListScreenBase<TScreenModel, TRowModel> without modifying the screen class itself. Implementations are discovered automatically via AddInManager — no DI registration required.

public abstract class ListScreenInjector<TScreen, TScreenModel, TRowModel> : ScreenInjector<TScreen> where TScreen : ListScreenBase<TScreenModel, TRowModel> where TScreenModel : DataListViewModel<TRowModel> where TRowModel : DataViewModelBase

Type Parameters

TScreen

The list screen type to inject into.

TScreenModel

The screen-level view model (wraps the row collection).

TRowModel

The per-row view model type.

Inheritance
ListScreenInjector<TScreen, TScreenModel, TRowModel>
Derived
ListScreenInjector<TScreen, TRowModel>
Inherited Members

Remarks

Example — adding toolbar and row actions to a list screen from another assembly:

using System.Collections.Generic;
using Dynamicweb.CoreUI.Actions;
using Dynamicweb.CoreUI.Screens;
using Dynamicweb.Products.UI.Models;
using Dynamicweb.Products.UI.Screens;

public sealed class MyProductListScreenInjector : ListScreenInjector<ProductListScreen, ProductListModel, ProductDataModel> { // Adds a button to the screen toolbar. public override IEnumerable<ActionGroup>? GetScreenActions() { return new[] { new ActionGroup { Nodes = [ new MyScreenAction() ] } }; }

// Adds a context-menu item to every row.
public override IEnumerable<ActionGroup>? GetListItemActions(ProductDataModel model)
{
    if (model is null)
        return null;

    return new[]
    {
        new ActionGroup { Nodes = [ new MyRowAction(model.Id) ] }
    };
}

}

Use the two-parameter shorthand ListScreenInjector<TScreen, TRowModel> when the screen model is the standard DataListViewModel<T>.

Methods

GetCell(string, TRowModel)

Override to return a custom Cell for a column. Return null to use the screen's default cell for that property.

public virtual Cell? GetCell(string propertyName, TRowModel model)

Parameters

propertyName string
model TRowModel

Returns

Cell

GetListItemActions(TRowModel)

Override to add per-row action groups (context menu items, row buttons, etc.).

public virtual IEnumerable<ActionGroup>? GetListItemActions(TRowModel model)

Parameters

model TRowModel

Returns

IEnumerable<ActionGroup>

GetScreenActions()

Override to add screen-level action groups (toolbar buttons, etc.).

public virtual IEnumerable<ActionGroup>? GetScreenActions()

Returns

IEnumerable<ActionGroup>
To top