[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Collapse]Application Model
   [Collapse]Model Editor
     Ways to Invoke the Model Editor
     Model Editor Toolbar
     Nodes Tree
     Property Grid
     Enhanced Editors
     Search Pane
     Unusable Nodes
     Model Editor Settings
    Application Model Basics
    Business Model in the Application Model
    Application Model Structure
    Access the Application Model in Code
    Extend and Customize the Application Model in Code
    Built-in Nodes Generators
    Convert Application Model Differences
    Model Difference Storages
  [Expand]UI Construction
  [Expand]Controllers and Actions
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging, Testing and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Ways to Invoke the Model Editor

The Model Editor can be used both at design time (in Visual Studio by a developer) and at run time (by application users and administrators). While the Model Editor invoked at design time is represented by a window pane in Visual Studio, the Model Editor invoked by end-users and administrators is represented by a form. The elements and capabilities in both these Model Editor representations are primarily the same. This topic describes how to invoke the Model Editor in different scenarios and is comprised of the following sections.

Expanded Invoke the Model Editor in the Visual Studio at Design Time

In Solution Explorer, double-click the Model.xafml or Model.DesignedDiffs.xafml file contained in the XAF solution's project (module or application project).

Also you can right-click the project and choose Open Model Editor in the context menu.

The Model Editor will be invoked in a window pane.

The model editor pane contains the Nodes Tree, Property Grid and the Search Pane (optionally). You can switch focus through these UI elements by pressing the TAB key. A description, type and a declaring interface of the currently selected node/property is displayed at the bottom.

For different projects, different information will be displayed. This information is collected from the modules that are added to the project for which you invoked the Model Editor. In addition, if this project is a module, the information the module itself is loaded as well. To see the list of loaded modules, see the corresponding Module Designer or Application Designer.

Everything you change in the Model Editor is saved to the Model.xafml or Model.DesignedDiffs.xafml file, depending on whether the changes were made in an application project or in a module. Changes are displayed in bold in the Model Editor. You can view the underlying XML code by right-clicking the XAFML file and choosing View code. These changes are superimposed on previous values loaded to the Application Model. Values specified in the Model Editor for the application project are the Application Model's final values. They are used when starting the application. For details, refer to the Application Model Basics topic.

Expanded Invoke the Model Editor via the Edit Model Action At Run Time

When the Edit Model or Administrative permission is granted to the current user, the EditModel Action is available in the Tools category of the WinForms application's root window. This Action is always available if the Security System is not enabled. Use the EditModel Action (or its CTRL+SHIFT+F1 shortcut) to invoke the Model Editor window.

In contrast to design time, at run time the Model Editor contains complete information, including recent changes made in a UI (layout, skin, etc.). By default, changes made by an end-user in a UI manually or in the Model Editor are saved to the Model.User.xafml file. This file is located in the folder with the application executable file by default. Alternatively, this file can be placed in a user's ApplicationData folder. Set the UserModelDiffsLocation configuration file key to CurrentUserApplicationDataFolder for this purpose. Another possible option is to store user settings in the database. For details, see Model Difference Storages.

Expanded Deploy and Run the Standalone Model Editor

The Model Editor can be used as a standalone utility. This approach can be used by the application administrator to edit a model of the deployed ASP.NET application or deployed Windows Forms application with the EditModel Action disabled. Do not use the standalone Model Editor for Mobile applications, because you need to rebuild your application after changing the Mobile Application Model. To use the standalone Model Editor, create a folder at a workstation or a server where the XAF application is deployed. Copy the %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Tools\eXpressAppFramework\Model Editor\DevExpress.ExpressApp.ModelEditor.v18.2.exe executable and %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Tools\eXpressAppFramework\Model Editor\DevExpress.ExpressApp.ModelEditor.v18.2.config configuration file from the developer workstation to the newly created folder. Copy the following assemblies to the same folder.

  • DevExpress.Data.v18.2.dll
  • DevExpress.ExpressApp.Images.v18.2.dll
  • DevExpress.ExpressApp.Win.v18.2.dll
  • DevExpress.ExpressApp.Xpo.v18.2.dll
  • DevExpress.ExpressApp.v18.2.dll
  • DevExpress.Office.v18.2.Core.dll
  • DevExpress.Persistent.Base.v18.2.dll
  • DevExpress.RichEdit.v18.2.Core.dll
  • DevExpress.Utils.v18.2.dll
  • DevExpress.Xpo.v18.2.dll
  • DevExpress.XtraBars.v18.2.dll
  • DevExpress.XtraEditors.v18.2.dll
  • DevExpress.XtraLayout.v18.2.dll
  • DevExpress.XtraRichEdit.v18.2.dll
  • DevExpress.XtraTreeList.v18.2.dll
  • DevExpress.XtraVerticalGrid.v18.2.dll
  • All assemblies that are required by your XAF application (deployed together with the WinForms executable, or located in the Bin subfolder of the ASP.NET application).

These assemblies are available in the %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Bin\Framework folder at the developer workstation.

Note

These assemblies and executables are redistributable. You can register the required assemblies in the Global Assembly Cache (GAC), instead of copying them to the Model Editor folder.

After invoking the standalone Model Editor, you should specify an Application Model to edit via the Open Model dialog. This dialog is opened initially. You can re-invoke it later via the Open Model button at the toolbar.

To edit the Application Model of the deployed XAF application, you should specify the configuration file name only. An option to choose an assembly file and model differences path provides you with ability to edit model of a certain module outside the Visual Studio.

You can also specify an Application Model to open via command-line parameters. The standalone Model Editor has the following command-line syntax:

DevExpress.ExpressApp.ModelEditor.v18.2.exe appConfigFile | moduleAssemblyFile diffsPath | /?

Parameter

Description

appConfigFile

Specifies an XAF application configuration file. Pass this parameter to edit the Application Model of a deployed XAF application (Windows Forms or ASP.NET).

Example:

DevExpress.ExpressApp.ModelEditor.v18.2.exe d:\sites\MySolution\Web.config

moduleAssemblyFile

Specifies an XAF module's assembly file (DLL). Pass this parameter followed by the diffsPath parameter to edit the Application Model of an XAF module.

Example:

DevExpress.ExpressApp.ModelEditor.v18.2.exe

d:\Projects\MySolution\MySolution.Module\Bin\Debug\MySolution.Module.dll

d:\Projects\MySolution\MySolution.Module

diffsPath

This parameter specifies a model differences folder, and is required when the first parameter specifies an assembly. Typically, you should pass a module project's folder that contains a Model.DesignedDiffs.xafml file to modify.

/?

Displays a help message on using parameters above.

So, to edit the Application Model of the deployed application, type the Model Editor executable full path in the command prompt and pass the application configuration file full path as the parameter. The Model Editor represented as a form will be invoked.

Alternatively, you can right-click the configuration file in Windows Explorer and choose the Model Editor executable via the Open With... menu item.

Note

The Windows Forms application configuration file is <Application_Name>.Win.exe.config. The ASP.NET application configuration file is Web.config.

To edit the Application Model of an XAF module, type the Model Editor executable full path in the command prompt and pass the assembly file and the differences folder as parameters (see the table above).

Is this topic helpful?​​​​​​​