bovender framework
C# framework that implements MVVM and more
Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel > Class Template Referenceabstract

Collection of view models that automatically syncs with an associated collection of model objects. More...

Inheritance diagram for Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel >:

Public Member Functions

void RemoveSelected ()
 Removes all selected view models from the collection. More...
 
 ViewModelCollection (ObservableCollection< TModel > modelCollection)
 

Protected Member Functions

abstract TViewModel CreateViewModel (TModel model)
 
void SynchronizeOn ()
 Turns on synchronization of the view model collection and the model collection by adding appropriate event handles. More...
 
void SynchronizeOff ()
 Turns off synchronization of the view model collection and the model collection by removing the event handles. More...
 
void BuildViewModelCollection ()
 

Properties

int CountSelected [get, set]
 
TViewModel LastSelected [get, set]
 

Events

EventHandler< PropertyChangedEventArgs > ViewModelPropertyChanged
 Relays property-changed events from the view models in the collection. More...
 

Detailed Description

Collection of view models that automatically syncs with an associated collection of model objects.

Template Parameters
TModel
TViewModel
Type Constraints
TViewModel :ViewModelBase 

Definition at line 36 of file ViewModelCollection.cs.

Member Function Documentation

void Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel >.RemoveSelected ( )
inline

Removes all selected view models from the collection.

Inspired by http://stackoverflow.com/a/26523396/270712

Definition at line 71 of file ViewModelCollection.cs.

void Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel >.SynchronizeOff ( )
inlineprotected

Turns off synchronization of the view model collection and the model collection by removing the event handles.

Definition at line 222 of file ViewModelCollection.cs.

void Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel >.SynchronizeOn ( )
inlineprotected

Turns on synchronization of the view model collection and the model collection by adding appropriate event handles.

Definition at line 208 of file ViewModelCollection.cs.

Event Documentation

EventHandler<PropertyChangedEventArgs> Bovender.Mvvm.ViewModels.ViewModelCollection< TModel, TViewModel >.ViewModelPropertyChanged

Relays property-changed events from the view models in the collection.

Definition at line 95 of file ViewModelCollection.cs.


The documentation for this class was generated from the following file: