OTHER RELATED ARTICLES:
- WPF - Visual Studio Integration and Designer Support in .NET Core 3.0
- THIS POST: Getting Started with DevExpress WPF Controls for .NET Core
- Migrate WPF Apps to .NET Core (coming soon)
- How to Deploy a .NET Core 3 App (coming soon)
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
- .NET Core 3 SDK
- Visual Studio 2019 version 16.3 (with the .NET desktop development workload installed)
Step-by-Step Tutorial
- Open Visual Studio 2019 v16.3 and create a new WPF Application (.NET Core).
- 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}/apiSelect 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.
- 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); } }
- 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>
- 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