企業Enterprise

本文概述通用 Windows 平台 (UWP) 針對 Windows 10 應用程式而提供的重要企業功能。This article provides an overview of key enterprise features provided by the Universal Windows Platform (UWP) for Windows 10 apps. 如需詳盡示範其中部分功能的影片,請參閱使用 UWP 和 Visual Studio 快速建構 LOB 應用程式For a video that demonstrates some of these features in detail, see Rapidly Construct LOB Applications with UWP and Visual Studio.

功能要點Feature highlights

Windows Template StudioWindows Template Studio

Windows Template Studio 是 Visual Studio 2019 的擴充功能,可讓您更快速地使用精靈式體驗建立新的通用 Windows 平台 (UWP) 應用程式。Windows Template Studio is a Visual Studio 2019 extension that accelerates the creation of new Universal Windows Platform (UWP) apps using a wizard-based experience. 產生的 UWP 專案是語式正確且容易閱讀的程式碼,並且會在實作經過實證的模式和最佳做法時包含最新的 Windows 10 功能。The resulting UWP project is well-formed, readable code that incorporates the latest Windows 10 features while implementing proven patterns and best practices.

Windows Template Studio

請參閱 Windows Template StudioSee Windows Template Studio

用來建立桌面樣式 UI 的控制項Controls to create desktop-style UIs

我們發行了新的 UWP XAML 控制項,用以填補傳統桌面應用程式 UI 與 UWP UI 之間的差距。We've released new UWP XAML controls that fill the gap between a traditional desktop application UI and a UWP UI.

例如,新的 MenuBarDropDownButtonSplitButtonCommandBarFlyout 控制項可讓您更靈活地公開命令,而 EditableComboBox 則可讓使用者輸入預先定義的選項清單中未列出的值。For example, the new MenuBar, DropDownButton, SplitButton, and CommandBarFlyout controls give you more flexible ways to expose commands, and the EditableComboBox let's the user enter values that aren't listed in a pre-defined list of options.

MenuBar

用來支援企業案例的控制項Controls to support enterprise scenarios

DataGridView 可讓您靈活顯示資料列和資料行中的資料集合。The DataGridView provides a flexible way to display a collection of data in rows and columns.

TreeView 啟用提供包含巢狀項目的展開及摺疊節點的階層式清單。The TreeView enables a hierarchical list with expanding and collapsing nodes that contain nested items. 此控制項可以用來說明 UI 中的資料夾結構或巢狀關聯性。It can be used to illustrate a folder structure or nested relationships in your UI.

DataGrid 控制項

Windows UI 程式庫Windows UI Library

Windows UI 程式庫是一組 NuGet 套件,可提供 UWP 應用程式的控制項和其他使用者介面元素。The Windows UI Library is a set of NuGet packages that provide controls and other user interface elements for UWP apps. 此外也提供對舊版 Windows 10 的向下相容性,因此即便使用者沒有最新的作業系統,您的應用程式仍可運作。It also enables down-level compatibility with earlier versions of Windows 10, so your app works even if users don't have the latest OS.

Windows UI 程式庫

請參閱 Windows UI 程式庫 (預覽版)See Windows UI Library (Preview version).

傳統型應用程式中的 UWP 控制項 (XAML Island)UWP controls in desktop applications (XAML Islands)

Windows 10 現在可讓您在 WPF、Windows Forms 和 C++ Win32 傳統型應用程式中使用 UWP 控制項,其使用的功能名為 XAML IslandsWindows 10 now enables you to use UWP controls in WPF, Windows Forms, and C++ Win32 desktop applications using a feature called XAML Islands. 這表示您可以使用只能透過 UWP 控制項 (例如 Windows Ink) 和支援 Fluent Design 系統的控制項存取的最新 Windows 10 UI 功能,來增強現有傳統型應用程式的外觀與風格和功能。This means that you can enhance the look, feel, and functionality of your existing desktop applications with the latest Windows 10 UI features that are only available via UWP controls, such as Windows Ink and controls that support the Fluent Design System. 這項功能稱為 XAML Islands。This feature is called XAML islands.

請參閱傳統型應用程式中的 UWP 控制項See UWP controls in desktop applications.

.NET Standard 2.0.NET Standard 2.0

.NET Standard 包含的 API 比 .NET Standard 1.x 多出 20,000 餘個。The .NET Standard includes over 20,000 more APIs than .NET Standard 1.x. 因此,要移轉現有的 .NET Framework 程式庫,然後在不同的 .NET 應用程式 (包括您的 UWP 應用程式) 之間使用這些程式庫,將比以往容易得多。This makes it so much easier to migrate existing .NET Framework libraries and then use them across different .NET applications including your UWP application.

net-standard

請參閱在傳統型應用程式與 UWP 應用程式之間共用程式碼See Share code between a desktop app and a UWP app.

SQL Server 連線SQL Server connectivity

您的應用程式可以直接連線到 SQL Server 資料庫,然後使用 System.Data.SqlClient 命名空間中的類別儲存和擷取資料。Your app can connect directly to a SQL Server database and then store and retrieve data by using classes in the System.Data.SqlClient namespace.

請參閱在 UWP app 中使用 SQL Server 資料庫See Use a SQL Server database in a UWP app.

MSIX 部署MSIX deployment

MSIX 是一種 Windows 應用程式套件格式,結合了 MSI、.appx、App-V 和 ClickOnce 的最佳功能,以對所有 Windows 應用程式提供現代化且可靠的封裝體驗。MSIX is a Windows app package format that combines the best features of MSI, .appx, App-V, and ClickOnce to provide a modern and reliable packaging experience to all Windows apps. MSIX 套件格式除了支援對 Win32、WPF 和 Windows Forms 應用程式的新式封裝和部署功能,也保留了現有應用程式套件和安裝檔案的功能。The MSIX package format preserves the functionality of existing app packages and install files in addition to enabling modern packaging and deployment features to Win32, WPF, and Windows Forms apps.

MSIX 圖示

請參閱 MSIX 文件See MSIX documentation.

安全性Security

Windows 10 提供一套安全性功能,讓應用程式開發人員保護其使用者的身分識別、公司網路的安全性以及裝置上儲存的任何商務資料。Windows 10 provides a suite of security features for app developers to protect the identity of their users, the security of corporate networks, and any business data stored on devices. Windows 10 的新增功能是 Microsoft Passport,一種可使用 PIN 或 Windows Hello 存取的易部署雙因素密碼替代方式,可提供企業級安全性,以及支援指紋、臉部和虹膜辨識。New for Windows 10 is Microsoft Passport, an easy-to-deploy two-factor password alternative that is accessible by using a PIN or Windows Hello, which provides enterprise grade security and supports fingerprint, facial, and iris based recognition.

主題Topic 描述Description
安全開發 Windows app 的簡介Intro to secure Windows app development 這篇簡介文章說明不同驗證階段 (包括傳輸中資料和靜態資料) 的各種 Windows 安全功能。This introductory article explains various Windows security features across the stages of authentication, data-in-flight, and data-at-rest. 其也描述如何將這些階段整合到您的應用程式中。It also describes how you can integrate those stages into your apps. 本文涵蓋大範圍的主題,主要目的是協助應用程式設計人員更充分地了解可快速且輕易地建立通用 Windows 平台應用程式的 Windows 功能。It covers a large range of topics, and is aimed primarily at helping app architects better understand the Windows features that make creating Universal Windows Platform apps quick and easy.
驗證和使用者識別Authentication and user identity UWP 應用程式有本文所述的數個使用者驗證選項。UWP apps have several options for user authentication which are outlined in this article. 若要用於企業,則強烈建議選用新的 Microsoft Passport 功能。For the enterprise, the new Microsoft Passport feature is strongly recommended. Microsoft Passport 以增強式雙因素驗證 (2FA) 取代密碼,方法是驗證現有的認證,以及建立以生物識別或 PIN 式使用者手勢所保護的裝置特定認證,以產生方便且高度安全的使用經驗。Microsoft Passport replaces passwords with strong two-factor authentication (2FA) by verifying existing credentials and by creating a device-specific credential that a biometric or PIN-based user gesture protects, resulting in a both convenient and highly secure experience.
碼編譯Cryptography 密碼編譯一節概述 UWP 應用程式所提供的密碼編譯功能。The cryptography section provides an overview of the cryptography features available to UWP apps. 文章的範圍包括從如何輕鬆加密機密商業資料的簡介逐步解說,到操作密碼編譯金鑰,以及使用 MAC、雜湊和簽章這類進階主題。Articles range from introductory walkthroughs on how to easily encrypt sensitive business data, to advanced to advanced topics such as manipulating cryptographic keys and working with MACs, hashes, and signatures.
Windows 資訊保護 (WIP)Windows Information Protection (WIP) 這是一個中樞主題,從開發人員角度來探討 Windows 資訊保護 (WIP) 與檔案、緩衝區、剪貼簿、網路、背景工作的關聯,以及資料鎖定時的保護。This is a hub topic covering the full developer picture of how Windows Information Protection (WIP) relates to files, buffers, clipboard, networking, background tasks, and data protection under lock.

資料繫結和資料庫Data binding and databases

資料繫結可讓您的應用程式 UI 顯示來自外部來源 (例如資料庫) 的資料,以及選擇性地與該資料保持同步。Data binding is a way for your app's UI to display data from an external source, such as a database, and optionally to stay in sync with that data. 資料繫結可讓您將資料與 UI 分開考量,為應用程式建構更簡單的概念模型,以及更好的可讀性、測試性和維護性。Data binding allows you to separate the concern of data from the concern of UI, and that results in a simpler conceptual model as well as better readability, testability, and maintainability of your app.

主題Topic 描述Description
資料繫結概觀Data binding overview 本主題說明如何在通用 Windows 平台 (UWP) 應用程式中將控制項 (或其他 UI 元素) 繫結到單一項目,或將項目控制項繫結到項目集合。This topic shows you how to bind a control (or other UI element) to a single item or bind an items control to a collection of items in a Universal Windows Platform (UWP) app. 此外,還會示範如何控制項目的呈現、根據選擇來實作詳細資料檢視,以及轉換資料以供顯示。In addition, it shows how to control the rendering of items, implement a details view based on a selection, and convert data for display.
Entity Framework 7 for UWPEntity Framework 7 for UWP 對大型資料集執行複雜查詢,可使用支援 UWP 的 Entity Framework 7 進行大幅簡化。Performing complex queries against large data sets is vastly simplified using Entity Framework 7, which supports UWP. 在這個逐步解說中,您將建置 UWP 應用程式,以使用 Entity Framework 對本機 SQLite 資料庫執行基本資料存取。In this walkthrough, you will build a UWP app that performs basic data access against a local SQLite database using Entity Framework.
SQLite 本機資料庫SQLite local database 這個影片是使用 SQLite 的完整開發人員指南,而 SQLite 是本機應用程式資料庫的建議方案。This video is a comprehensive developer's guide to using SQLite, the recommended solution for local app databases. 請瀏覽 SQLite 以下載 UWP 的最新版本,或使用 Windows 10 SDK 已隨附的版本。Visit SQLite to download the latest version for UWP, or use the version that's already provided with the Windows 10 SDK.

網路功能和資料序列化Networking and data serialization

企業營運應用程式通常需要與各種其他系統通訊,或在各種其他系統上儲存資料。Line-of-business apps often need to communicate with or store data on a variety of other systems. 做法通常是連線到網路服務 (使用 REST 或 SOAP 這類通訊協定),然後序列化資料或將資料還原序列化成通用格式。This is typically accomplished by connecting to a network service (using protocols such as REST or SOAP) and then serializing or deserializing data into a common format. 在與 WPF、WinForm 和 ASP.NET 應用程式類似的 UWP 應用程式中,使用網路和資料序列化。Working with networks and data serialization in UWP apps similar to WPF, WinForms, and ASP.NET applications. 如需詳細資訊,請參閱下列文章。See the following articles for more information.

主題Topic 描述Description
網路功能基本知識Networking basics 這個逐步解說說明與所有 UWP 應用程式相關的基本網路概念 (不論使用中的通訊協定為何)。This walkthrough explains basic networking concepts relevant to all UWP apps, regardless of the communication protocols in use.
哪一種網路功能技術?Which networking technology? 適用於 UWP 應用程式的網路功能技術快速概觀,並建議您如何選擇最適合您應用程式的技術。A quick overview of the networking technologies available for UWP apps, with suggestions on how to choose the technologies that are the best fit for your app.
XML 和 SOAP 序列化XML and SOAP serialization XML 序列化會將物件轉換成符合特定 XML 結構描述定義語言 (XSD) 的 XML 資料流。XML serialization converts objects into an XML stream that conforms to a specific XML Schema definition language (XSD). 若要在 XML 與強型別類別之間進行轉換,您可以使用原生 XDocument 類別或外部程式庫。To convert between XML and a strongly-typed class, you can use the native XDocument class, or an external library.
JSON 序列化JSON serialization JSON (JavaScript 物件標記法) 序列化是與 REST API 進行通訊的常用格式。JSON (JavaScript object notation) serialization is a popular format for communicating with REST APIs. UWP 應用程式完全支援的 Newtonsoft Json.NETThe Newtonsoft Json.NET, which is fully supported for UWP apps.

裝置Devices

為了與企業營運工具 (如印表機、條碼掃描器或智慧卡讀卡機) 整合,您可能會發現必須將外部裝置或感應器與您的應用程式整合。In order to integrate with line-of-business tools, like printers, barcode scanners, or smart card readers, you may find it necessary to integrate external devices or sensors into your app. 以下是一些功能範例,您可以使用本節所描述的技術將這些功能新增到您的應用程式中。Here are some examples of features that you can add to your app using the technology described in this section.

主題Topic 描述Description
列舉裝置Enumerate devices 本文說明如何使用 Windows.Devices.Enumeration 命名空間來尋找內部連接到系統、外部連接或者可透過無線或網路通訊協定偵測到的裝置。This article explains how to use the Windows.Devices.Enumeration namespace to find devices that are internally connected to the system, externally connected, or detectable over wireless or networking protocols. 如果您要建置任何與裝置搭配運作的應用程式,請從這裡開始。Start here if you're building any app that works with devices.
列印與掃描Printing and scanning 說明如何從您的應用程式進行列印和掃描,包括連接和使用企業裝置,例如銷售點 (POS) 系統、收據印表機,以及高容量送紙器掃描器。Describes how to print and scan from your app, including connecting to and working with business devices like point-of-sale (POS) systems, receipt printers, and high-capacity feeder scanners.
BluetoothBluetooth 除了使用傳統藍牙連線來傳送和接收資料或控制裝置,Windows 10 還可使用藍牙低功耗 (BTLE) 在背景傳送或接收指標。In addition to using traditional Bluetooth connections to send and receive data or control devices, Windows 10 enables using Bluetooth Low Energy (BTLE) to send or receive beacons in the background. 使用這個項目,以在使用者接近或離開特定位置時顯示通知或啟用功能。Use this to display notifications or enable functionality when a user gets close to or leaves a particular location.
企業共用存放裝置Enterprise shared storage 在裝置鎖定案例中,了解如何在相同的應用程式內、應用程式與執行個體之間,或甚至應用程式之間共用資料。In device lockdown scenarios, learn how data can be shared within the same app, between instances of an app, or even between apps.

裝置目標Device targeting

許多使用者現在都會將他們的手機或平板電腦帶去上班,而手機或平板電腦的板型規格和螢幕大小都不同。Many users today are bringing their own phone or tablet to work, which have varying form factors and screen sizes. 您可以使用通用 Windows 平台 (UWP) 撰寫在所有不同類型的裝置上流暢執行的單一企業營運應用程式 (包括桌上型電腦電腦和 PPI 顯示器),可讓您充分擴展使用應用程式的範圍並將程式碼效率提到最高。With the Universal Windows Platform (UWP), you can write a single line-of-business app that runs seamlessly on all different types of devices, including desktop PCs and PPI displays, allowing you to maximize the reach of your app and the efficiency of your code.

主題Topic 描述Description
UWP 應用程式指南Guide to UWP apps 在本簡介指南中,您將了解 Windows 10 UWP 平台,包括︰裝置系列為何以及如何決定要設為目標的裝置系列、新的 UI 控制項和面板以讓您將 UI 調整為不同的裝置板型規格,以及如何了解與控制可供您的應用程式使用的 API 表面。In this introductory guide, you'll get acquainted with the Windows 10UWP platform, including: what a device family is and how to decide which one to target, new UI controls and panels that allow you to adapt your UI to different device form factors, and how to understand and control the API surface that is available to your app.
彈性 XAML UI 程式碼範例Adaptive XAML UI code sample 這個程式碼範例說明應用程式的所有可能版面配置選項和控制項 (不論裝置類型為何),並可讓您與面板互動以顯示如何達成您要尋找的任何版面配置。This code sample shows all the possible layout options and controls for your app, regardless of device type, and allows you to interact with the panels to show how to achieve any layout you are looking for. 除了顯示每個控制項如何回應不同的板型規格之外,應用程式本身也具有回應,並顯示達成彈性 UI 的各種方法。In addition to showing how each control responds to different form factors, the app itself is responsive and shows various methods for achieving adaptive UI.
Xamarin 主題Xamarin topic 以手機為目標的 XamarinXamarin for targeting phone

部署Deployment

您可以選擇使用 MSIX 套件將應用程式發佈至組織使用者。You have options for distributing apps to your organization’s users using MSIX packages. 您可以設定以應用程式安裝程式為基礎的部署、使用裝置管理工具 (例如 Microsoft Endpoint Configuration Manager 和 Microsoft Intune) 發佈到商務用 Microsoft Store,或側載應用程式至裝置。You can configure an App Installer-based deployment, use device management tools such as Microsoft Endpoint Configuration Manager and Microsoft Intune, publish to the Microsoft Store for Business, or you can sideload apps to devices. 您也可藉由發佈到 Microsoft Store,將您的應用程式提供給一般大眾。You can also make your apps available to the general public by publishing to the Microsoft Store.

主題Topic 描述Description
MSIX 文件MSIX documentation MSIX 是一種 Windows 應用程式套件格式,結合了 MSI、.appx、App-V 和 ClickOnce 的最佳功能,以提供現代化且可靠的封裝體驗。MSIX is a Windows app package format that combines the best features of MSI, .appx, App-V, and ClickOnce to provide a modern and reliable packaging experience.
將 LOB 應用程式發佈到企業Distribute LOB apps to enterprises 了解發佈企業營運應用程式的選項,而不將應用程式廣泛地提供給公眾使用,包括以應用程式安裝程式為基礎的部署、Microsoft Endpoint Configuration Manager 和 Microsoft Intune,以及發佈至商務用 Microsoft Store。Learn about the options for distributing line-of-business apps without making the apps broadly available to the public, including App Installer-based deployment, Microsoft Endpoint Configuration Manager and Microsoft Intune, and publishing to the Microsoft Store for Business.
側載 appSideload apps 當您側載應用程式時,您要將簽署的應用程式套件部署到裝置。When you sideload an app, you deploy a signed app package to a device. 您要維護這些應用程式的簽署、裝載和部署。You maintain the signing, hosting, and deployment of these apps. 用於側載應用程式的程序已經簡化為適用於 Windows 10。The process for sideloading apps is streamlined for Windows 10.
將應用程式發佈至 Microsoft StorePublish apps to the Microsoft Store 整合的 Windows Store 可讓您發佈與管理您為所有 Windows 裝置開發的所有應用程式。The unified Microsoft Store lets you publish and manage all of your apps for all Windows devices. 透過每個市場價格、發佈和可見性控制項,以及其他選項來自訂您應用程式的可用性。Customize your app’s availability with per-market pricing, distribution and visibility controls, and other options.

企業 UWP 範例Enterprise UWP samples

主題Topic 描述Description
VanArsdel 清查範例VanArsdel Inventory Sample 示範企業營運案例的 UWP 範例應用程式。A UWP sample app that showcases line-of-business scenarios. 此範例主要說明如何為虛構公司 VanArsdel 建立和管理客戶、訂單和產品。The sample is based around creating and managing customer, orders, and products for the fictitious company VanArsdel.
客戶訂單資料庫範例Customer Orders Database Sample 這是一個 UWP 範例應用程式,示範對企業開發人員有幫助的功能,例如 Azure Active Directory (AAD) 驗證、UI 控制項 (包括資料格)、Sqlite 與 SQL Azure 資料庫整合、Entity Framework 和雲端 API 服務等。A UWP sample app that showcases features useful to enterprise developers, like Azure Active Directory (AAD) authentication, UI controls (including a data grid), Sqlite and SQL Azure database integration, Entity Framework, and cloud API services. 此範例主要說明如何為虛構公司 Contoso 建立和管理客戶帳戶、訂單和產品。The sample is based around creating and managing customer accounts, orders, and products for the fictitious company Contoso.

模式和做法Patterns and practices

大型企業級應用程式的程式碼庫會變得雜亂無章。Code bases for large scale, enterprise-grade apps can become unwieldy. Prism 是一個架構,用於在 WPF、Windows 10 UWP 和 Xamarin Forms 中建置鬆散結合、可維護和可測試的 XAML 應用程式。Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms. Prism 提供一組設計模式的實作,這組設計模式有助於撰寫結構完善且可維護的 XAML 應用程式,包括 MVVM、相依性導入、命令、EventAggregator 和其他項目。Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others.

如需 Prism 的詳細資訊,請參閱 GitHub 存放庫For more information on Prism, see the GitHub repo.