How to use an eXpand module with an existing XAF application

XAF Team Blog
01 August 2011

Let me describe for a moment how we at DevExpress work. We build and sell software which means that we only sell and provide support for products that have been built and tested by us! However I am here as a framework evangelist and huge XAF fan. This makes it my duty to spread the word as much as I can and make XAF even bigger. To this end through collaboration within the XAF community, we have been building and supporting eXpand. This framework follows XAF to the letter and takes things even further. eXpand gets its inspiration from real life situations and bases itself on examples from DevExpress Support Center. eXpand is the first open source project based on the DevExpress eXpressApp Framework (XAF). More info is available at www.expandframework.com and our very existence relies on your efforts! Anyone is welcome to contribute and enjoy the rewards. It is not necessary to be a XAF guru, we can all manage to create a behavior taken from DevExpress code central. Let’s work together to enhance our beloved XAF!

Using an eXpand module with an existing XAF application is an issue that is being raised a lot recently and I am sure it deserves a post and a place in Xpand Wiki. The following information applies to any Xpand module. Note that installing an Xpand module is almost as easy as using a XAF one.

20/08/12 (Modules can be used without the core functionality http://goo.gl/JU5hi)

Introduction

Firstly, as a base type for our application components it is imperative to use XpandWinApplication or XpandWebApplication. Therefore we need to reference Xpand.ExpressApp.Win or Xpand.ExpressApp.Web assemblies from our application projects and replace their components’ base types accordingly,

image

Additionally we need to reference Xpand.Persistent.BaseImpl and set its Copy Local attribute to true. Having similar architecture with XAF, eXpand modules use interfaces and their implementations are hosted in the BaseImpl assembly. Xpand modules know how to locate the Business Objects they require so this is all we need to do at this point.

Note; BaseImpl assembly has no references to DX BaseImpl and it is possible to use a replace it with a custom one .

Registering in Toolbox (Obsolete after v11.1.8.13 - Toolbox is autopopulated now)

Now, unless we are a XAF guru, we have to register the assemblies in the VS toolbox. I suggest creating the toolbox items within a new Xpand Tab as shown. At this point we don’t have the resources to create our own ToolBoxCreator utility. If any VS IDE guru wants to contribute such a tool, we owe him one!

image image

Registration

Registering and using a module is as easy as dragging and dropping it into the Application Designer. The designer will then add all required references and modules for us.

image

Give us your feedback

Was this post useful to you? Do you want to learn more about Xpand framework? We would love to hear your feedback!

Happy eXpanding!

Updated: 19/12/2012

Under folder Demos/Modules there is a set of solutions that can guide you how to install each module seperately

4 comment(s)
Alain Bismark
Alain Bismark

Great!

Can you provide information about which functionalities are ready to use inheriting from XpandWinApplication and using Xpand.Persistent.BaseImpl?

Thanks

1 August, 2011
Apostolis Bekiaris (DevExpress)
Apostolis Bekiaris (DevExpress)

Hi Alain

XpandWinApplication or its interfaces are required from core modules (Xpand.ExpressApp, Xpand.ExpressApp.Win, Xpand.ExpressApp.Web). However it is not imperative to derive from this class, you can instead implement its interfaces (ISupportModelsManager, ISupportCustomListEditorCreation, IWinApplication, ISupportConfirmationRequired, ISupportAfterViewShown, ISupportLogonParameterStore, ISupportFullConnectionString). However this is not trivial as you can tell. Each interface extends application component's behavior. All those interfaces live inside the Xpand.ExpressApp core assembly. The current architecture allows each module to reference the core assemblies and make use of these interfaces as well. This is how the module extends the functionality of the XafApplication descendants. Bottom line if you want to use only one module you may get away by implementing just 1 or to of them

2 August, 2011
Stepan Lauryn
Stepan Lauryn

Hi, I try add XPAND Library to AF project. I have this error after login to XAF application:

Add a business object that implements Xpand.Persistent.Base.General.ISequenceObject at your AdditionalBusinessClasses (module.designer.cs)

Can you help me?

Stepan

6 November, 2011
Apostolis Bekiaris (DevExpress)
Apostolis Bekiaris (DevExpress)

Hi Stepan

Consider using Xpand forums to get support its hard to trace or answer tickets here. Thanks for your understanding

7 November, 2011

Please login or register to post comments.