[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Expand]Controls and Libraries
 [Collapse]Scaffolding Wizard
   Getting Started
  [Expand]Overview
  [Expand]Data Access Layer
   UI Generation
  [Expand]Examples
  [Expand]Tutorials
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

UI Generation

This step-by-step tutorial shows how to run Scaffolding Wizard and build a fully functional MVVM data-bound WPF application.

First of all, you need a WPF application with a Data Access Layer, based on which Scaffolding Wizad will generate the Model, View Model, and View layers. The Data Access Layer can be generated in different ways. Each approach is described in the following documentation section: Data Access Layer. There are three tutorials there. The result of each tutorial is a WPF project with a ready Data Access Layer. You can pass one of these tutorials or download one of the ready examples (for instance, this one).

Open the example with a Data Access Layer, build it, and follow the below steps.

There are three complete sample projects in the DevExpress Code Examples database at:

Expanded Run Scaffolding Wizard

Right click the solution in the Solution Explorer and choose the Add DevExpress Item | New Item option.

In the Template Gallery window, find the WPF View Scaffolding section, choose a UI type to generate and click Run Wizard. See this topic for more details about supported UI types.

Expanded Generate Views

When the wizard is run, it looks for all data models in the current project and project references. Select the required Model and click Next.

If you do not see the created model, be sure to rebuild the project. In the next step of the wizard, you can select tables to include in the generated classes, and also make certain tables read only. After customizing these settings, click Finish and wait until the wizard generates the necessary files and references. If you have not yet rebuilt the project, do so now.

Expanded Run Application

Look at the Views generated folder. In contains subfolders for each data table. Each subfolder contains a view for showing records in a table, and a view for editing a record in a table (if the table is not read only).

One view is not included in the subfolder. It is the main view, which aggregates the others. To show this view in the application, it is necessary to add this view to the MainWindow.

After that, you can run the application.

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