Add a Class from the Business Class Library (XPO)
- 2 minutes to read
In this lesson, you will learn how to use business classes from the Business Class Library as is. For this purpose, you will add the Event business class to the application.
Before proceeding, take a moment to review the Inherit from the Business Class Library Class (XPO) lesson.
In the Solution Explorer, find the Module.cs (Module.vb) file within the MySolution.Module project. Double-click it to invoke the Module Designer.
In the Exported Types section, locate the Referenced Assemblies | DevExpress.Persistent.BaseImpl.v20.2 | Event node. Select it and press the SPACEBAR, or right-click it and choose Use Type in Application in the invoked context menu. The node will be marked in bold. This means that the Event business class will be added to the Application Model, and this class will take part in the UI construction process. The use of extra modules is detailed in the Extra Modules section of this tutorial.
Run the WinForms or ASP.NET application and note that the Scheduler Event navigation item is created, as the Event class has the NavigationItemAttribute applied. Note that it may be necessary to add other classes from the Business Class Library to the navigation manually (see the Add an Item to the Navigation Control topic).
XAF has a special Scheduler module contains List Editor that uses the Scheduler Control (Win/Web) to display and manage Event business objects in XAF applications. Refer to the Add the Scheduler Module lesson to learn how to use it in your application.
You can see the changes made in the Main Demo installed with XAF. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 20.2\Components.NET Core Desktop Libraries\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/.
Next Lesson: Set a Many-to-Many Relationship (XPO)