翻譯|使用教程|編輯:龔雪|2021-06-29 10:28:00.283|閱讀 351 次
概述:本教程介紹如何創(chuàng)建.NET 5 應(yīng)用程序,將其配置為使用 DevExpress WPF控件,以及添加Spreadsheet控件。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
DevExpress WPF擁有120+個控件和庫,將幫助您交付滿足甚至超出企業(yè)需求的高性能業(yè)務(wù)應(yīng)用程序。通過DevExpress WPF能創(chuàng)建有著強大互動功能的XAML基礎(chǔ)應(yīng)用程序,這些應(yīng)用程序?qū)W⒂诋?dāng)代客戶的需求和構(gòu)建未來新一代支持觸摸的解決方案。 無論是Office辦公軟件的衍伸產(chǎn)品,還是以數(shù)據(jù)為中心的商業(yè)智能產(chǎn)品,都能通過DevExpress WPF控件來實現(xiàn)。
本教程介紹如何創(chuàng)建.NET 5 應(yīng)用程序,將其配置為使用 DevExpress WPF控件,以及添加Spreadsheet控件。
下載DevExpress v21.1完整版 DevExpress v21.1漢化資源獲取
打開 Visual Studio 2019 并創(chuàng)建一個新項目,選擇DevExpress v21.1 WPF App Template Gallery模板。
指定項目名稱和位置。
在DevExpress Template Gallery中,選擇.Net Core平臺、Blank Application模板和.NET 5.0版本。
在Solution Explorer中右鍵單擊項目,然后選擇Edit Project File。
將 UseWindowsForms 鍵設(shè)置為 true:
XAML
<PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net5.0-windows</TargetFramework> <UseWPF>true</UseWPF> <UseWindowsForms>true</UseWindowsForms> </PropertyGroup>
注意:
許多 DevExpress 產(chǎn)品都有一個跨平臺的核心部分,它依賴于 Windows Forms 程序集,因此建議將 UseWindowsForms 標(biāo)志設(shè)置為 true。
1. 跳轉(zhuǎn)到Tools | NuGet Package Manager | Manage NuGet Packages for Solution。
2. 在“Browse”標(biāo)簽中,搜索“WindowsDesktop.Wpf.Themes”關(guān)鍵字并為當(dāng)前項目安裝 DevExpress.WindowsDesktop.Wpf.Themes.All 包,接受許可協(xié)議。
3. 構(gòu)建解決方案。
1. 打開MainWindow.xaml。
2. 添加以下 DevExpress 命名空間引用:
XAML
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
3. 將Spreadsheet控件從Visual Studio 工具箱拖動到 XAML 代碼,更改應(yīng)用程序標(biāo)記如下:
XAML
<dx:ThemedWindow x:Class="DxWPFNetCoreApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 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> </dx:ThemedWindow>
4. 構(gòu)建并運行解決方案。
DevExpress技術(shù)交流群4:715863792 歡迎一起進群討論
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)