mirror of
https://github.com/DevExpress/netcore-winforms-demos.git
synced 2026-01-30 20:46:44 +00:00
Add Outlook Inspired and Stock Market demos
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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 {
|
||||
/// <summary>
|
||||
/// Represents the Orders collection view model.
|
||||
/// </summary>
|
||||
public partial class OrderCollectionViewModel : CollectionViewModel<Order, long, IDevAVDbUnitOfWork> {
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of OrderCollectionViewModel as a POCO view model.
|
||||
/// </summary>
|
||||
/// <param name="unitOfWorkFactory">A factory used to create a unit of work instance.</param>
|
||||
public static OrderCollectionViewModel Create(IUnitOfWorkFactory<IDevAVDbUnitOfWork> unitOfWorkFactory = null) {
|
||||
return ViewModelSource.Create(() => new OrderCollectionViewModel(unitOfWorkFactory));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the OrderCollectionViewModel class.
|
||||
/// This constructor is declared protected to avoid undesired instantiation of the OrderCollectionViewModel type without the POCO proxy factory.
|
||||
/// </summary>
|
||||
/// <param name="unitOfWorkFactory">A factory used to create a unit of work instance.</param>
|
||||
protected OrderCollectionViewModel(IUnitOfWorkFactory<IDevAVDbUnitOfWork> unitOfWorkFactory = null)
|
||||
: base(unitOfWorkFactory ?? UnitOfWorkSource.GetUnitOfWorkFactory(), x => x.Orders, query => query.Include(x => x.Store).Include(x => x.Customer).ActualOrders().OrderBy(x => x.InvoiceNumber)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user