using System; using System.Linq; using DevExpress.Mvvm.POCO; using DevExpress.DevAV.Common.Utils; using DevExpress.DevAV.DevAVDbDataModel; using DevExpress.Mvvm.DataModel; using DevExpress.DevAV; using DevExpress.DevAV.Common.ViewModel; namespace DevExpress.DevAV.ViewModels { /// /// Represents the Employees collection view model. /// public partial class EmployeeCollectionViewModel : CollectionViewModel { /// /// Creates a new instance of EmployeeCollectionViewModel as a POCO view model. /// /// A factory used to create a unit of work instance. public static EmployeeCollectionViewModel Create(IUnitOfWorkFactory unitOfWorkFactory = null) { return ViewModelSource.Create(() => new EmployeeCollectionViewModel(unitOfWorkFactory)); } /// /// Initializes a new instance of the EmployeeCollectionViewModel class. /// This constructor is declared protected to avoid undesired instantiation of the EmployeeCollectionViewModel type without the POCO proxy factory. /// /// A factory used to create a unit of work instance. protected EmployeeCollectionViewModel(IUnitOfWorkFactory unitOfWorkFactory = null) : base(unitOfWorkFactory ?? UnitOfWorkSource.GetUnitOfWorkFactory(), x => x.Employees) { } } }