Getting Started with DevExpress WPF Controls for .NET Core

WPF Team Blog
25 October 2019

OTHER RELATED ARTICLES:

  1. WPF - Visual Studio Integration and Designer Support in .NET Core 3.0
  2. THIS POST: Getting Started with DevExpress WPF Controls for .NET Core
  3. Migrate WPF Apps to .NET Core
  4. How to Deploy a .NET Core WPF App

This guide describes how you can create a .NET Core 3 application, configure it to use DevExpress WPF controls, and how to add a DevExpress control to the app itself (for this tutorial, we’ll show you how to add our Spreadsheet control to your .NET Core 3 project).

Prerequisites

Step-by-Step Tutorial

  1. Open Visual Studio 2019 v16.3 and create a new WPF Application (.NET Core).

  2. Add DevExpress NuGet Packages

    In this blog post, we describe how to get DevExpress WPF Controls via DevExpress NuGet Feed. The Getting Started topic describes how to use DevExpress WPF Controls for .NET Core from a local feed.

    Obtain your personal NuGet feed URL.

    Go to Tools | NuGet Package Manager | Manage NuGet Packages for Solution

    Open "Settings"...

    ... and add a new NuGet feed with the following attributes:

    Name: DevExpress
    Source: https://nuget.devexpress.com/{your feed authorization key}/api

    Select the DevExpress package source you just added.

    In the "Browse" tab, search for 'WindowsDesktop.Wpf' and install the following two packages into the current project.

    • DevExpress.WindowsDesktop.Wpf
    • DevExpress.WindowsDesktop.Wpf.Themes.Office2019Colorful

    Read and accept the license agreement.

    Build the solution. This will force the project to resolve all NuGet package dependencies. Visual Studio will load available controls into its Toolbox.

  3. Apply an Application Theme

    Set the ApplicationThemeHelper.ApplicationThemeName property to the desired theme name at application startup.

    public partial class App : Application {
        protected override void OnStartup(StartupEventArgs e) {
            DevExpress.Xpf.Core.ApplicationThemeHelper.ApplicationThemeName = 
                DevExpress.Xpf.Core.Theme.Office2019ColorfulName;
            base.OnStartup(e);
        }
    }
  4. Add the control.

    Drag the Spreadsheet control from the Visual Studio Toolbox to the XAML code. Change the application markup as follows:

    <Window x:Class="DxWPFNetCoreApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxsps="http://schemas.devexpress.com/winfx/2008/xaml/spreadsheet"
        xmlns:local="clr-namespace:DxWPFNetCoreApp"
        Title="MainWindow" Height="450" Width="800">
        <Grid>
            <dxsps:SpreadsheetControl CommandBarStyle="Ribbon" ShowFormulaBar="True"/>
        </Grid>
    </Window>
    

     

  5. Build and run the solution. Congrats, you’ve just built your own .NET Core 3 Spreadsheet app 😉

Documentation

Our .NET Core 3 documentation contains numerous resources including migration guides, and known limitations.

We'd Love to Hear From You

As always, thanks for choosing DevExpress for your software development needs. Please take a moment to share your thoughts with us and tell us about your upcoming .NET Core project. Comment below or email us at wpfteam@devexpress.com

2 comment(s)
Cyber Sinh
Cyber Sinh

Hi,

Is there a way to install individual control nuget (like DevExpress.WindowsDesktop.Wpf.Grid) instead of installing all controls through the meta-package DevExpress.WindowsDesktop.Wpf? I cannot find the package DevExpress.WindowsDesktop.Wpf.Grid in the nuget manager in Visual Studio 16.3. Thanks. 

25 October, 2019
Alex Chuev (DevExpress)
Alex Chuev (DevExpress)
Smaller packages for .NET Core 3 controls are currently unlisted in the online NuGet feed. You can still install them using the Package Manager Console:
Install-Package DevExpress.WindowsDesktop.Wpf.Grid
28 October, 2019

Please login or register to post comments.