Skip to main content

Create a WPF Dashboard Viewer (.NET Framework)

  • 2 minutes to read

This topic describes how to build a simple WPF Viewer application in .NET Framework and use it to display the dashboard created in Visual Studio.

Follow the steps below to build a WPF Viewer application.

  1. In Visual Studio, create a new project and select WPF App (.NET Framework) on the start page as the project template.
  2. Drag DashboardControl from the DX.24.2: Data & Analytics Toolbox tab and drop it onto the main form.

    GettingStarted_WpfViewer_Toolbox

  3. Right-click the control and select Layout | Reset All to allow the DashboardControl to fill the entire window.

    GettingStarted_WpfViewer_ResetLayout

  4. Click the control’s smart tag and select the Set Dashboard Source command.

    GettingStarted_WpfViewer_SetDashboardSource

    Select Create new Dashboard in the invoked menu.

    GettingStarted_WpfViewer_SetDashboardSource_Create

  5. Visual Studio displays the designer for the newly created dashboard.

    GettingStarted_WpfViewer_VSDesigner

    Do one of the following to design a dashboard:

  6. Make sure that the DashboardControl.DashboardSource property is specified in the DashboardControl’s XAML code:

    <Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:dxdash="http://schemas.devexpress.com/winfx/2008/xaml/dashboard"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        x:Class="WpfApp1.MainWindow"
            mc:Ignorable="d"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <dxdash:DashboardControl DashboardSource="{x:Type local:Dashboard1}"/>
        </Grid>
    </Window>
    
  7. Run the application to see the result.

    GettingStarted_WpfViewer_Result

Next Steps