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.
Constructors
Name | Description |
---|---|
CollectionViewModelBase(IUnitOfWorkFactory<TUnitOfWork>, Func<TUnitOfWork, IRepository<TEntity, TPrimaryKey>>, Func<IRepositoryQuery<TEntity>, IQueryable<TProjection>>, Action<TEntity>, Func<Boolean>, Boolean, UnitOfWorkPolicy) | Initializes a new instance of the CollectionViewModelBase<TEntity, TProjection, TPrimaryKey, TUnitOfWork> class with specified settings. |
Properties
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, Object) static | Determines whether the specified object instances are considered equal. Inherited from Object. |
Equals(Object) | Determines whether the specified object is equal to the current object. 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. |