internal
static
ContentViewControlElement DefineProductsFrontendContentView(ConfigElement parent)
{
// define content view control
var controlDefinition =
new
ContentViewControlElement(parent)
{
ControlDefinitionName = ProductsDefinitions.FrontendDefinitionName,
ContentType =
typeof
(ProductItem)
};
// *** define views ***
var productsListView =
new
ContentViewMasterElement(controlDefinition.ViewsConfig)
{
ViewName = ProductsDefinitions.FrontendListViewName,
ViewType =
typeof
(ProductCatalogSample.Web.UI.Public.MasterListView),
AllowPaging =
true
,
DisplayMode = FieldDisplayMode.Read,
ItemsPerPage = 20,
ResourceClassId =
typeof
(ProductsResources).Name,
FilterExpression = DefinitionsHelper.PublishedOrScheduledFilterExpression,
SortExpression =
"PublicationDate DESC"
};
controlDefinition.ViewsConfig.Add(productsListView);
var productsDetailsView =
new
ContentViewDetailElement(controlDefinition.ViewsConfig)
{
ViewName = ProductsDefinitions.FrontendDetailViewName,
ViewType =
typeof
(ProductDetailsView),
ShowSections =
false
,
DisplayMode = FieldDisplayMode.Read,
ResourceClassId =
typeof
(ProductsResources).Name
};
controlDefinition.ViewsConfig.Add(productsDetailsView);
return
controlDefinition;
}