Create a WPF Dashboard Viewer Application using the .NET CLI Project Template
- 3 minutes to read
You can use the .NET command-line interface (CLI) to create an application with the WPF Dashboard Viewer control from the console. Note that the project template targets .NET 8.0+ and supports C# only.
Note
We implemented a new dotnet CLI-powered Project Wizard you can use across multiple IDEs: Cross-IDE Project Template Kit.
#Install DevExpress CLI Templates
Execute the following command to install DevExpress WPF project templates from nuget.org:
dotnet new install DevExpress.WPF.ProjectTemplates
If the NuGet.org package source is disabled, you will get the following error: NU1101: Unable to find package DevExpress.WPF.ProjectTemplates. To see the list of sources and their status information, run the command dotnet nuget list source
. To enable a source, run the command dotnet nuget enable source <source name>
.
If you are new to NuGet, visit the following page for more information about package management prerequisites: An Introduction to NuGet.
Note
DevExpress CLI project templates are also available in the DevExpress Nu
#Create a Project
To create a WPF Dashboard Viewer application, execute the following command:
dotnet new dx.wpf.dashboard -n WpfDashboardViewer
The command creates a WPF application with Dashboard Viewer application called WpfDashboardViewer in the current directory.
You can use the following parameters to see available command options: -? | -h | --help
. For example, execute the following command:
dotnet new dx.wpf.dashboard --help
Refer to the following documents for information on template options:
- dotnet new command - Options
- Standard options for .NET CLI templates.
- Template Options
- Options specific to the DevExpress WPF templates.
#Build the Project
You need to configure your personal DevExpress NuGet Feed to load the required DevExpress component packages and build the resulting project. Follow the instructions below:
- Obtain your NuGet feed URL.
Register the source. You can do this in your IDE or from a CLI:
#Template Options
The following list contains options you can specify when creating DevExpress WPF BI Dashboard project templates:
-prerelease, --use-prerelease-dx-version
- A flag that indicates whether to use a pre-release DevExpress package version in the project.
--framework <TFM>
- Specifies the target framework. It expects a target framework moniker (TFM). Example:
net8.0
. --dx-version <version>
- Specifies DevExpress package version to be used in the project. Examples:
24.2.3
,24.2.*
,24.2.*-*
--dx-nuget-feed <feed>
- Specifies the NuGet Feed URL. Refer to nuget.devexpress.com to obtain your personal feed URL (available for registered users).
-preload, --preload-resources
Preload theme resources on application launch to speed up the display time for all subsequent windows. For more information, refer to Preload Theme Resources.
Default: true
-lwthemes, --lightweight-themes
Use DevExpress lightweight themes instead of regular themes. For more information, refer to Lightweight Themes.
Default: true