Add a Class from the Business Class Library (XPO)
- 2 minutes to read
Tip
For .NET 6 applications, see: Inherit from the Business Class Library Class (XPO, .NET 6).
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.
Note
Before proceeding, take a moment to review the Inherit from the Business Class Library Class 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.Xpo.v22.1 | 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 Web Forms 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).
Tip
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 22.1\Components\XAF\MainDemo by default. The ASP.NET Web Forms version is available online at https://demos.devexpress.com/XAF/MainDemo.
Next Lesson: Set a Many-to-Many Relationship