CollectionViewModelBase<TEntity, TProjection, TPrimaryKey, TUnitOfWork> Members

The base class for POCO view models exposing a collection of entities of a given type and CRUD operations against these entities.

It is not recommended to inherit directly from this class. Use the CollectionViewModel class instead.

Properties

Name Description
AllowSaveReset Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.
CanSerialize Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
DocumentManagerService Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
Entities The collection of entities loaded from the unit of work. Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.
EntityDisplayName The display name of TEntity to be used when presenting messages to the user.
FilterExpression The lambda expression used to filter which entities will be loaded locally from the unit of work. Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
IsLoading Used to check whether entities are currently being loaded in the background. The property can be used to show the progress indicator. Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.
LookupViewModels Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
ParentViewModel Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.
SelectedEntity The selected entity. Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
UnitOfWorkFactory Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.
UnitOfWorkPolicy Inherited from EntitiesViewModelBase<TEntity, TProjection, TUnitOfWork>.

Methods

Name Description
CanDelete(TProjection)

Determines whether an entity can be deleted. Since CollectionViewModelBase is a POCO view model, this method will be used as a CanExecute callback for DeleteCommand.

CanEdit(TProjection)

Determines whether an entity can be edited. Since CollectionViewModelBase is a POCO view model, this method will be used as a CanExecute callback for EditCommand.

CanRefresh() Determines whether entities can be reloaded. Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
CanReset()
CanSave(TProjection)

Determines whether entity local changes can be saved. Since CollectionViewModelBase is a POCO view model, this method will be used as a CanExecute callback for SaveCommand.

Close()

Closes the corresponding view. Since CollectionViewModelBase is a POCO view model, an the instance of this class will also expose the CloseCommand property that can be used as a binding source in views.

Delete(TProjection)

Deletes a given entity from the repository and saves changes if confirmed by the user. Since CollectionViewModelBase is a POCO view model, an the instance of this class will also expose the DeleteCommand property that can be used as a binding source in views.

Edit(TProjection)

Creates and shows a document that contains a single object view model for the existing entity. Since CollectionViewModelBase is a POCO view model, an the instance of this class will also expose the EditCommand property that can be used as a binding source in views.

Equals(Object) Determines whether the specified object is equal to the current object. Inherited from Object.
Equals(Object, Object) static Determines whether the specified object instances are considered equal. Inherited from Object.
GetHashCode() Serves as the default hash function. Inherited from Object.
GetType() Gets the Type of the current instance. Inherited from Object.
MemberwiseClone() protected Creates a shallow copy of the current Object. Inherited from Object.
New()

Creates and shows a document that contains a single object view model for new entity. Since CollectionViewModelBase is a POCO view model, an the instance of this class will also expose the NewCommand property that can be used as a binding source in views.

OnLoaded() Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
OnUnloaded() Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
ReferenceEquals(Object, Object) static Determines whether the specified Object instances are the same instance. Inherited from Object.
Refresh() Reloads entities. Inherited from ReadOnlyCollectionViewModelBase<TEntity, TProjection, TUnitOfWork>.
Reset()
RestoreState(CollectionViewModelState)
Save(TProjection)

Saves the given entity. Since CollectionViewModelBase is a POCO view model, the instance of this class will also expose the SaveCommand property that can be used as a binding source in views.

SaveState()
SendRefreshCollectionsMessage()
ToString() Returns a string that represents the current object. Inherited from Object.
UpdateSelectedEntity()

Notifies that SelectedEntity has been changed by raising the PropertyChanged event. Since CollectionViewModelBase is a POCO view model, an the instance of this class will also expose the UpdateSelectedEntityCommand property that can be used as a binding source in views.

See Also