Table of Contents

Class ScreenService

Namespace
The.WPF.Screens
Assembly
Instagile.WPF.dll
public sealed class ScreenService
Inheritance
ScreenService
Inherited Members

Constructors

ScreenService(IServices, IControllerFactory, VirtualisationOptions, TimeSpan?, TimeSpan?, ScreenConfiguration)

public ScreenService(IServices services, IControllerFactory controllerFactory, VirtualisationOptions virtualisationOptions, TimeSpan? searchDelay, TimeSpan? saveNotificationTimeout, ScreenConfiguration screenConfiguration)

Parameters

services IServices
controllerFactory IControllerFactory
virtualisationOptions VirtualisationOptions
searchDelay TimeSpan?
saveNotificationTimeout TimeSpan?
screenConfiguration ScreenConfiguration

Fields

SearchDelay

public readonly TimeSpan? SearchDelay

Field Value

TimeSpan?

Methods

CreateContentController<T>(T, Action<ContentOptions>?)

Views or edits the properties of a single T

public ContentControllerBase<T> CreateContentController<T>(T e, Action<ContentOptions>? configure = null) where T : IEntity<T>

Parameters

e T

The entity to edit.

configure Action<ContentOptions>

Optional. An action to run to modify screen behaviour.

Returns

ContentControllerBase<T>

Type Parameters

T

CreateCreateController<T>(Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Action<T>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Action<T> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

init Action<T>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, Task<T>>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, Task<T>> entityFactory, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, Task<T>>

An action to run to create the entity.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, Task<T>>, Action<T>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, Task<T>> entityFactory, Action<T> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, Task<T>>

An action to run to create the entity.

init Action<T>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, Task<T>>, Func<T, Task>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, Task<T>> entityFactory, Func<T, Task> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, Task<T>>

An action to run to create the entity.

init Func<T, Task>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, T>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, T> entityFactory, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, T>

An action to run to create the entity.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, T>, Action<T>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, T> entityFactory, Action<T> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, T>

An action to run to create the entity.

init Action<T>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<IPrincipal, T>, Func<T, Task>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<IPrincipal, T> entityFactory, Func<T, Task> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, T>

An action to run to create the entity.

init Func<T, Task>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(Func<T, Task>, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(Func<T, Task> init, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

init Func<T, Task>

An action to run on the entity after creating it. If this fails, the screen still loads.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateController<T>(T, Action<CreateOptions>?)

Creates and saves a T

public CreateController<T> CreateCreateController<T>(T e, Action<CreateOptions>? configure = null) where T : IEntity<T>

Parameters

e T

A prebuilt entity.

configure Action<CreateOptions>

Optional. An action to run to modify screen behaviour.

Returns

CreateController<T>

Type Parameters

T

CreateCreateModalController<T>()

Creates and returns a T

public IModalController<T> CreateCreateModalController<T>() where T : IEntity<T>

Returns

IModalController<T>

Type Parameters

T

CreateCreateModalController<T>(Action<T>)

Creates and returns a T

public IModalController<T> CreateCreateModalController<T>(Action<T> init) where T : IEntity<T>

Parameters

init Action<T>

An action to run on the entity before exposing it to the user.

Returns

IModalController<T>

Type Parameters

T

CreateCreateModalController<T>(Func<IPrincipal, Task<T>>)

Creates and returns a T

public IModalController<T> CreateCreateModalController<T>(Func<IPrincipal, Task<T>> entityFactory) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, Task<T>>

An action to create the entity before exposing it to the user.

Returns

IModalController<T>

Type Parameters

T

CreateCreateModalController<T>(Func<IPrincipal, T>)

Creates and returns a T

public IModalController<T> CreateCreateModalController<T>(Func<IPrincipal, T> entityFactory) where T : IEntity<T>

Parameters

entityFactory Func<IPrincipal, T>

An action to create the entity before exposing it to the user.

Returns

IModalController<T>

Type Parameters

T

CreateCreateModalController<T>(Func<T, Task>)

public IModalController<T> CreateCreateModalController<T>(Func<T, Task> init) where T : IEntity<T>

Parameters

init Func<T, Task>

An action to run on the entity before exposing it to the user.

Returns

IModalController<T>

Type Parameters

T

CreateCreateModalController<T>(T)

Creates and returns a T

public IModalController<T> CreateCreateModalController<T>(T e) where T : IEntity<T>

Parameters

e T

A prebuilt entity.

Returns

IModalController<T>

Type Parameters

T

CreateCriteriaController<T>(Action<CriteriaOptions>?)

Creates a search specification for a T

public CriteriaController<T> CreateCriteriaController<T>(Action<CriteriaOptions>? configure = null) where T : IEntity<T>

Parameters

configure Action<CriteriaOptions>

Returns

CriteriaController<T>

Type Parameters

T

Remarks

Right now generated code makes the query factory for this overload, but we could do it here with only slight overhead.

CreateCriteriaController<T>(Func<IEntityContext, IEntityQuery<T>>, Action<CriteriaOptions>?)

Creates a search specification for a T

public CriteriaController<T> CreateCriteriaController<T>(Func<IEntityContext, IEntityQuery<T>> queryFactory, Action<CriteriaOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IEntityQuery<T>>
configure Action<CriteriaOptions>

Returns

CriteriaController<T>

Type Parameters

T

CreateCriteriaController<T>(Func<IEntityContext, IQueryable<T>>, Action<CriteriaOptions>?)

Creates a search specification for a T

public CriteriaController<T> CreateCriteriaController<T>(Func<IEntityContext, IQueryable<T>> queryFactory, Action<CriteriaOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IQueryable<T>>
configure Action<CriteriaOptions>

Returns

CriteriaController<T>

Type Parameters

T

CreateDisplayController<T>(Guid, Action<DisplayOptions>?)

Loads a T from the datastore, allowing the user to view or edit it

public DisplayController<T> CreateDisplayController<T>(Guid id, Action<DisplayOptions>? configure = null) where T : IEntity<T>

Parameters

id Guid

The ID of the entity to load

configure Action<DisplayOptions>

Optional. An action to run to modify screen behaviour.

Returns

DisplayController<T>

Type Parameters

T

CreateDisplayModalController<T>(bool, T)

Views or edits a T in memory

public IModalController<T> CreateDisplayModalController<T>(bool isEditable, T clonee) where T : IEntity<T>

Parameters

isEditable bool
clonee T

Returns

IModalController<T>

Type Parameters

T

CreateGridController<T>(IEntitySet<T>, Action<GridOptions>?)

Edits multiple Ts

public GridController<T> CreateGridController<T>(IEntitySet<T> es, Action<GridOptions>? configure = null) where T : IEntity<T>

Parameters

es IEntitySet<T>
configure Action<GridOptions>

Returns

GridController<T>

Type Parameters

T

CreateListController<T>(IEntityQuery<T>, Action<ListOptions>?)

Views multiple Ts

public ListController<T> CreateListController<T>(IEntityQuery<T> query, Action<ListOptions>? configure = null) where T : IEntity<T>

Parameters

query IEntityQuery<T>
configure Action<ListOptions>

Returns

ListController<T>

Type Parameters

T

CreateListController<T>(IEntityQuery<T>, int, Action<ListOptions>?)

Views multiple Ts with known count

public ListController<T> CreateListController<T>(IEntityQuery<T> query, int count, Action<ListOptions>? configure = null) where T : IEntity<T>

Parameters

query IEntityQuery<T>
count int
configure Action<ListOptions>

Returns

ListController<T>

Type Parameters

T

CreateListController<T>(IEntitySet<T>, Action<ListOptions>?)

Views multiple Ts from an entity set

public ListController<T> CreateListController<T>(IEntitySet<T> entitySet, Action<ListOptions>? configure = null) where T : IEntity<T>

Parameters

entitySet IEntitySet<T>
configure Action<ListOptions>

Returns

ListController<T>

Type Parameters

T

CreateListController<T>(IFrozenQuery<T>, Action<ListOptions>?)

Views multiple Ts from a frozen query

public ListController<T> CreateListController<T>(IFrozenQuery<T> frozenQuery, Action<ListOptions>? configure = null) where T : IEntity<T>

Parameters

frozenQuery IFrozenQuery<T>
configure Action<ListOptions>

Returns

ListController<T>

Type Parameters

T

CreateSearchController<T>(Action<SearchOptions>?)

Searches for sets of T based on live criteria

public SearchController<T> CreateSearchController<T>(Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

configure Action<SearchOptions>

Returns

SearchController<T>

Type Parameters

T

CreateSearchController<T>(Func<IEntityContext, IEntityQuery<T>>, Action<SearchOptions>?)

Searches for sets of T based on live criteria

public SearchController<T> CreateSearchController<T>(Func<IEntityContext, IEntityQuery<T>> queryFactory, Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IEntityQuery<T>>
configure Action<SearchOptions>

Returns

SearchController<T>

Type Parameters

T

CreateSearchController<T>(Func<IEntityContext, IQueryable<T>>, Action<SearchOptions>?)

Searches for sets of T based on live criteria

public SearchController<T> CreateSearchController<T>(Func<IEntityContext, IQueryable<T>> queryFactory, Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IQueryable<T>>
configure Action<SearchOptions>

Returns

SearchController<T>

Type Parameters

T

CreateSearchModalController<T>(Action<SearchOptions>?)

Selects a T based on search criteria

public IModalController<T> CreateSearchModalController<T>(Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

configure Action<SearchOptions>

Returns

IModalController<T>

Type Parameters

T

CreateSearchModalController<T>(Func<IEntityContext, IEntityQuery<T>>, Action<SearchOptions>?)

Selects a T based on search criteria

public IModalController<T> CreateSearchModalController<T>(Func<IEntityContext, IEntityQuery<T>> queryFactory, Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IEntityQuery<T>>
configure Action<SearchOptions>

Returns

IModalController<T>

Type Parameters

T

CreateSearchModalController<T>(Func<IEntityContext, IQueryable<T>>, Action<SearchOptions>?)

Selects a T based on search criteria

public IModalController<T> CreateSearchModalController<T>(Func<IEntityContext, IQueryable<T>> queryFactory, Action<SearchOptions>? configure = null) where T : IEntity<T>

Parameters

queryFactory Func<IEntityContext, IQueryable<T>>
configure Action<SearchOptions>

Returns

IModalController<T>

Type Parameters

T

GetDisplayContext(ISurface)

If the screen is being used to display a property, returns the metadata for that property; otherwise returns null.

public PropertyInfo? GetDisplayContext(ISurface surface)

Parameters

surface ISurface

Returns

PropertyInfo

NotifyEntitiesSaved(IEnumerable<EntityKernel>, EntityKernel?)

public void NotifyEntitiesSaved(IEnumerable<EntityKernel> entities, EntityKernel? topLevelEntity = null)

Parameters

entities IEnumerable<EntityKernel>
topLevelEntity EntityKernel

NotifyEntitiesSaved(IEnumerable<IEntity>, IEntity?)

public void NotifyEntitiesSaved(IEnumerable<IEntity> entities, IEntity? topLevelEntity = null)

Parameters

entities IEnumerable<IEntity>
topLevelEntity IEntity

NotifyEntitiesSaved(ILookup<IEntityInfo, (Guid ID, string Text, bool IsDeleted, bool IsTopLevel)>)

public void NotifyEntitiesSaved(ILookup<IEntityInfo, (Guid ID, string Text, bool IsDeleted, bool IsTopLevel)> entitiesByMetadata)

Parameters

entitiesByMetadata ILookup<IEntityInfo, (Guid ID, string Text, bool IsDeleted, bool IsTopLevel)>

NotifyEntityOpened(IEntityInfo, Guid, string)

public void NotifyEntityOpened(IEntityInfo type, Guid id, string text)

Parameters

type IEntityInfo
id Guid
text string

WithDisplayContextAsync<T>(ISurface, PropertyInfo, Func<Task<T>>)

public Task<T> WithDisplayContextAsync<T>(ISurface surface, PropertyInfo context, Func<Task<T>> f)

Parameters

surface ISurface
context PropertyInfo
f Func<Task<T>>

Returns

Task<T>

Type Parameters

T

WithDisplayContext<T>(ISurface, PropertyInfo, Func<T>)

public T WithDisplayContext<T>(ISurface surface, PropertyInfo context, Func<T> f)

Parameters

surface ISurface
context PropertyInfo
f Func<T>

Returns

T

Type Parameters

T

Events

EntitiesSaved

public event ScreenService.EntitiesSavedEventHandler? EntitiesSaved

Event Type

ScreenService.EntitiesSavedEventHandler

EntityOpened

public event ScreenService.EntityOpenedEventHandler? EntityOpened

Event Type

ScreenService.EntityOpenedEventHandler