Class ListController<T>
Initializes a new instance of the ListController<T> class.
public class ListController<T> : ScreenControllerBase<ListModel<T>, ListView, ListOptions>, IScreenController<ListModel<T>>, IScreenController where T : IEntity<T>
Type Parameters
T
- Inheritance
-
ListController<T>
- Implements
- Inherited Members
Constructors
ListController(IServices, IEntityQuery<T>, int?, Action<ListOptions>)
Initializes a new instance of the ListController<T> class.
public ListController(IServices services, IEntityQuery<T> query, int? count = null, Action<ListOptions> configure = null)
Parameters
servicesIServicesA framework instance.
queryIEntityQuery<T>The entity query that provides the data source for the list.
countint?Optional pre-computed count of entities in the query. If not provided, the count will be retrieved asynchronously.
configureAction<ListOptions>Optional action to configure list options.
ListController(IServices, IFrozenQuery<T>, Action<ListOptions>)
public ListController(IServices services, IFrozenQuery<T> query, Action<ListOptions> configure = null)
Parameters
servicesIServicesqueryIFrozenQuery<T>configureAction<ListOptions>
Methods
CopyCell(ListRow<T>, string)
public void CopyCell(ListRow<T> row, string columnKey)
Parameters
CopyRow(ListRow<T>)
public void CopyRow(ListRow<T> row)
Parameters
rowListRow<T>
CreateColumn(ListModel<T>, AttributeInfo)
protected virtual ListColumn CreateColumn(ListModel<T> vm, AttributeInfo a)
Parameters
vmListModel<T>aAttributeInfo
Returns
CreateColumn(ListModel<T>, RelationshipInfo)
protected virtual ListColumn CreateColumn(ListModel<T> vm, RelationshipInfo r)
Parameters
vmListModel<T>rRelationshipInfo
Returns
CreateDescriptionColumn(ListModel<T>)
protected virtual ListColumn CreateDescriptionColumn(ListModel<T> vm)
Parameters
vmListModel<T>
Returns
CreateUninitialisedModel(ISurface)
protected override ListModel<T> CreateUninitialisedModel(ISurface s)
Parameters
sISurface
Returns
- ListModel<T>
CreateUninitialisedRowModel()
protected virtual ListRow<T> CreateUninitialisedRowModel()
Returns
- ListRow<T>
EnsureLoadedAsync()
public Task EnsureLoadedAsync()
Returns
GetAvailableColumns(ListModel<T>)
protected virtual IEnumerable<ListColumn> GetAvailableColumns(ListModel<T> vm)
Parameters
vmListModel<T>
Returns
GetCurrentOrdering()
public (PropertyInfo metadata, bool ascending)[] GetCurrentOrdering()
Returns
GetCustomRowCommands(T)
protected virtual IEnumerable<IScreenCommand> GetCustomRowCommands(T row)
Parameters
rowT
Returns
GetOrderedQueryAsync(IEntityQuery<T>, IEnumerable<(PropertyInfo metadata, bool ascending)>)
Apply ordering to the query. Override this to provide custom sorting logic or in-memory transformation.
protected virtual Task<IEntityQuery<T>> GetOrderedQueryAsync(IEntityQuery<T> source, IEnumerable<(PropertyInfo metadata, bool ascending)> orderings)
Parameters
sourceIEntityQuery<T>orderingsIEnumerable<(PropertyInfo metadata, bool ascending)>
Returns
- Task<IEntityQuery<T>>
GetPreloadedPropertyPaths(ListModel<T>)
protected virtual IEnumerable<PropertyPath> GetPreloadedPropertyPaths(ListModel<T> model)
Parameters
modelListModel<T>
Returns
GetPreloadedRelationshipPaths(ListModel<T>)
protected virtual IEnumerable<RelationshipPath> GetPreloadedRelationshipPaths(ListModel<T> model)
Parameters
modelListModel<T>
Returns
GetPreloadedRelationships(ListModel<T>)
protected virtual IEnumerable<RelationshipInfo> GetPreloadedRelationships(ListModel<T> model)
Parameters
modelListModel<T>
Returns
InitialiseModel(ListModel<T>)
protected override void InitialiseModel(ListModel<T> vm)
Parameters
vmListModel<T>
OnClosed()
protected override sealed void OnClosed()
OnControllerClosed()
protected virtual void OnControllerClosed()
OnControllerOpened()
protected virtual void OnControllerOpened()
OnModalCancelled(IEntity)
protected virtual void OnModalCancelled(IEntity originalEntity)
Parameters
originalEntityIEntity
OnModalClosed(IEntity, IEntity)
protected virtual void OnModalClosed(IEntity originalEntity, IEntity editedEntity)
Parameters
OnModalOpened(IEntity)
protected virtual void OnModalOpened(IEntity originalEntity)
Parameters
originalEntityIEntity
OnModalOpening(IEntity)
protected virtual void OnModalOpening(IEntity originalEntity)
Parameters
originalEntityIEntity
OnOpened()
protected override sealed void OnOpened()
Open(T, bool)
create a Display or DisplayModal screen for an entity from the list
protected virtual Task Open(T e, bool foreground)
Parameters
eTforegroundbool
Returns
OpenAsync(T)
public virtual Task OpenAsync(T e)
Parameters
eT
Returns
OpenInNewTabAsync(T)
public Task OpenInNewTabAsync(T e)
Parameters
eT
Returns
RefreshAsync(bool)
public Task RefreshAsync(bool force = false)
Parameters
forcebool
Returns
RefreshAsync(IEntityQuery<T>, int?, bool)
public Task RefreshAsync(IEntityQuery<T> newQuery, int? newCount = null, bool force = false)
Parameters
newQueryIEntityQuery<T>newCountint?forcebool
Returns
RefreshAsync(IEntitySet<T>, bool)
public Task RefreshAsync(IEntitySet<T> newSet, bool force = false)
Parameters
newSetIEntitySet<T>forcebool
Returns
RefreshAsync(IFrozenQuery<T>, bool)
public Task RefreshAsync(IFrozenQuery<T> newQuery, bool force = false)
Parameters
newQueryIFrozenQuery<T>forcebool
Returns
Events
ModalCancelled
public event Action<IEntity> ModalCancelled
Event Type
ModalClosed
public event Action<IEntity, IEntity> ModalClosed
Event Type
ModalOpened
public event Action<IEntity> ModalOpened
Event Type
ModalOpening
public event Action<IEntity> ModalOpening