Class DisplayController<T>
public class DisplayController<T> : ScreenControllerBase<DisplayModel<T>, DisplayView, DisplayOptions>, IScreenController<DisplayModel<T>>, IScreenController where T : IEntity<T>
Type Parameters
T
- Inheritance
-
DisplayController<T>
- Implements
- Inherited Members
Constructors
DisplayController(IServices, Guid, Action<DisplayOptions>)
public DisplayController(IServices services, Guid id, Action<DisplayOptions> configure = null)
Parameters
servicesIServicesidGuidconfigureAction<DisplayOptions>
Fields
ID
public readonly Guid ID
Field Value
Metadata
protected readonly IEntityInfo Metadata
Field Value
Methods
CreateContentController(T)
protected virtual ContentControllerBase<T> CreateContentController(T entity)
Parameters
entityT
Returns
CreateLoadQuery(IEntityContext)
Create a query that will load the specified entity with appropriate inclusions.
protected virtual IEntityQuery<T> CreateLoadQuery(IEntityContext context)
Parameters
contextIEntityContext
Returns
- IEntityQuery<T>
CreateUninitialisedModel(ISurface)
protected override sealed DisplayModel<T> CreateUninitialisedModel(ISurface s)
Parameters
sISurface
Returns
- DisplayModel<T>
CreateUninitialisedModel(ISurface, bool, Task)
protected virtual DisplayModel<T> CreateUninitialisedModel(ISurface s, bool canBlock, Task loadTask)
Parameters
Returns
- DisplayModel<T>
GetCustomCommands(DisplayModel<T>)
protected virtual IEnumerable<IScreenCommand> GetCustomCommands(DisplayModel<T> vm)
Parameters
vmDisplayModel<T>
Returns
GetEntityAsync()
public Task<T> GetEntityAsync()
Returns
- Task<T>
GetIcons(T)
protected virtual IEnumerable<IconModel> GetIcons(T entity)
Parameters
entityT
Returns
GetTextForTitle(T)
protected virtual string GetTextForTitle(T entity)
Parameters
entityT
Returns
InitialiseModel(DisplayModel<T>)
protected override void InitialiseModel(DisplayModel<T> vm)
Parameters
vmDisplayModel<T>
LoadEntityAsync(CancellationToken)
[Obsolete("Overriding this method will disable caching. Instead, use some combination of CreateLoadQuery(), OnLoading[Async](), and OnLoaded[Async]() - or none of the above; CreateLoadQuery() comes with useful includes by default.")]
protected virtual Task<T> LoadEntityAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken
Returns
- Task<T>
OnClosed()
protected override sealed void OnClosed()
OnControllerClosed()
protected virtual void OnControllerClosed()
OnControllerOpened()
protected virtual void OnControllerOpened()
OnLoaded()
protected virtual void OnLoaded()
OnLoadedAsync()
protected virtual Task OnLoadedAsync()
Returns
OnLoading(T)
protected virtual void OnLoading(T entity)
Parameters
entityT
OnLoadingAsync(T)
protected virtual Task OnLoadingAsync(T entity)
Parameters
entityT
Returns
OnOpened()
protected override sealed void OnOpened()
OnSaved()
protected virtual void OnSaved()
OnSavedAsync()
protected virtual Task OnSavedAsync()
Returns
OnSaving()
protected virtual void OnSaving()
OnSavingAsync()
protected virtual Task OnSavingAsync()
Returns
RefreshAsync()
public virtual Task RefreshAsync()
Returns
SaveAsync()
public virtual Task SaveAsync()
Returns
Events
Loaded
public event Action Loaded
Event Type
Saved
public event Action Saved
Event Type
Saving
public event Action Saving