Skip to main content
A newer version of this page is available. .

Create a WPF Dashboard Application in .NET Core 3

  • 3 minutes to read

This tutorial describes how to create the WPF application with the Dashboard control in .NET Core 3.

Prerequisites

Create a New Project

You can create a new .NET Core project in the console window or use Visual Studio’s template.

Create a New .NET Core Project in the Console Window

Open the console window and perform the following steps:

  1. Create and open a new folder. The folder name is the project name.

    mkdir NewCoreApp
    cd NewCoreApp
    
  2. Create a WPF project:

    dotnet new wpf
    
  3. Create a solution file:

    dotnet new sln
    
  4. Add the created .NET Core 3 project to this solution:

    dotnet sln add NewCoreApp.csproj
    

Open the created solution in Visual Studio.

Create a New .NET Core Project in Visual Studio

  1. In Visual Studio, create a new project and select WPF App (.NET Core) on the start page as the project template.

Install Dashboard Packages

  1. Right-click the Dependencies node in the Solution Explorer and select Manage NuGet Packages in the invoked context menu.

  2. Register the DevExpress NuGet feed as a package source and select it in the drop-down menu.

  3. Select the DevExpress NuGet feed as a package source drop-down list and go to the Browse page. Install the DevExpress.WindowsDesktop.Wpf.Dashboard package.

The installed libraries are added to the project after the installation is completed.

Add WPF Dashboard Viewer

Add the DashboardControl to the MainWindow.xaml file and build the solution.

<Window x:Class="NewWpfApp.MainWindow"
        ...
        xmlns:dxdash="http://schemas.devexpress.com/winfx/2008/xaml/dashboard">
    <Grid>
        <dxdash:DashboardControl/>
    </Grid>
</Window>

Use the DashboardControl.DashboardSource property to provide an existing dashboard or follow the instructions below for information on how to create and edit a dashboard in Visual Studio.

Create and Edit a Dashboard in a .NET Core Project

Add an auxiliary .NET Framework project to the solution and use the Visual Studio Designer to create a new dashboard or edit an existing one.

  1. In Visual Studio, add new WPF App (.Net Framework) to your solution.

  2. Right-click the auxiliary .NET project and choose Add | New DevExpress Item | Dashboard… in the context menu.

  3. Open and configure the dashboard. Follow this step-by-step tutorial for more information: How to create a dashboard in the Visual Studio Designer.

  4. Cut the added dashboard from the auxiliary project and paste it in the .NET Core 3 project.

  5. Add the dashboard and its namespace to the MainWindow.xaml file and build the solution.

    <Window x:Class="NewWpfApp.MainWindow"
            ...
            xmlns:axe="clr-namespace:MyAuxiliaryProject"
            xmlns:dxdash="http://schemas.devexpress.com/winfx/2008/xaml/dashboard">
        <Grid>
            <dxdash:DashboardControl DashboardSource="{x:Type axe:Dashboard1}"/>
        </Grid>
    </Window>
    

Run the application to open the dashboard in the WPF Dashboard Viewer.

Edit a Migrated Dashboard

You can edit your Dashboard in the auxiliary project’s designer. For this, add the Dashboard1.cs dashboard from the .NET Core 3 project to the auxiliary project as a link:

In the auxiliary project, double-click the Dashboard1.cs file to edit this dashboard in the Visual Studio Designer.