Modernizing Your Windows Applications with the Windows App SDK and WinUI
eBook - ePub

Modernizing Your Windows Applications with the Windows App SDK and WinUI

Matteo Pagani, Marc Plogas

Buch teilen
  1. 514 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Modernizing Your Windows Applications with the Windows App SDK and WinUI

Matteo Pagani, Marc Plogas

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Use Windows App SDK and WinUI 3 to take your existing Windows desktop applications to the next level by enabling a modern and accessible UI and integrating the latest Windows features like WinML and Windows HelloKey Features• Improve your apps and enable them to support modern devices with features such as touch screens and responsive UI• Integrate your app with the latest Windows innovations using modern tools and the newest C# features• Reuse your existing knowledge in.NET, C#, and Visual Studio to create new Windows appsBook DescriptionIf you're a developer looking to improve and modernize your existing LOB applications to leverage modern Windows features without having to rewrite the entire application from scratch, this book is for you. You'll learn how to modernize your existing Windows Forms, WPF, and UWP applications and enrich them with the latest Windows features.Starting with sample LOB applications that cover common scenarios, you'll learn the differences between various components and then focus on design features for improved visual aspects like accessibility and responsive layouts.The book shows you how to enhance your existing applications using Windows App SDK components and various Windows APIs, resulting in deeper integration with the operating system. You'll be taking a closer look at WinML, which enables Windows applications to evaluate machine learning models offline and leverage the power of your machine, or notifications, to engage with your users in a more effective way. You'll also learn how to make your application deployment-ready by distributing it using various platforms like the Microsoft Store or websites.By the end of this Windows book, you'll be able to create a migration plan for your existing Windows applications and put your knowledge to work by enhancing your application with new features and integrating them with the Windows ecosystem.What you will learn• Understand the key concepts of the Windows App SDK and WinUI• Integrate new features by creating new applications or by enhancing your existing ones• Revamp your app's UI by adopting Fluent Design and new interaction paradigms such as touch and inking• Use notifications to engage with your users more effectively• Integrate your app with the Windows ecosystem using the Windows App SDK• Use WinML to boost your tasks using artificial intelligence• Deploy your application in LOB and customer-facing scenarios with MSIXWho this book is forThis book is for developers who are building Windows applications with Windows Forms, WPF, and UWP and would like to evolve and modernize their applications, but aren't able to rebuild them from scratch. This book focuses on Line-of-Business scenarios. Basic knowledge of Windows app development, .NET/C#, and Visual Studio will help you understand the concepts covered in this book.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Modernizing Your Windows Applications with the Windows App SDK and WinUI als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Modernizing Your Windows Applications with the Windows App SDK and WinUI von Matteo Pagani, Marc Plogas im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Ciencia de la computación & Programación de Microsoft. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Section 1: Basic Concepts

Section 1 will set the stage for working with the Windows App SDK and WinUI. The chapters will guide developers in understanding the current state of Windows app development, how to start a new project, and the key concepts to know, regardless of the starting technology.
This section contains the following chapter:
  • Chapter 1, Getting Started with the Windows App SDK and WinUI

Chapter 1: Getting Started with the Windows App SDK and WinUI

Windows desktop applications have always played a critical role in the enterprise and productivity space. No matter what you do in your day-to-day job, if you are using a computer in a professional capacity, you are using one or more desktop applications to get your job done – Visual Studio, Office, and Photoshop are just a few of the most famous examples. And let's not forget many of the line-of-business applications that we might use in our everyday jobs to perform tasks such as submitting expense reports or creating financial reports.
Web and mobile devices have certainly changed the ecosystem, and many of these tasks can be performed everywhere nowadays. But this doesn't mean that desktop applications aren't relevant anymore. They still play a critical role in our productivity, thanks to better performance, which makes them the best choice for heavy tasks such as video rendering or graphic design. They are optimized for mouse and keyboard, which is still the primary input method for scenarios such as coding, data entry, and data analysis. They can be deeply integrated with every type of external hardware, such as barcode readers, scanners, and blood sample testers.
For all these reasons, Microsoft continues to heavily invest in the Windows desktop space to provide developers the best platform and tools to create powerful experiences for their customers. And with the release of Windows 11, there's a renewed interest among developers to delight their users with applications that take advantage of the latest innovations in the platform.
In this chapter, we're going to explore the following topics:
  • What the Windows App SDK is and how it compares to the other existing development platforms for Windows
  • The role of the new .NET runtime
  • Choosing the right deployment model for your application
  • Creating your first Windows App SDK project
  • Managing the relationship between the Windows App SDK and Windows
  • Building libraries and components
These topics will set the stage for you to get started with the Windows App SDK and WinUI (the short name for Windows UI Library), which will be useful for the next chapters.

Technical requirements

To build applications with the Windows App SDK, you will need the following:
  • A computer with the latest version of Windows 10 or Windows 11.
  • Visual Studio 2022 with the following workloads:
  • Universal Windows Platform (UWP) development
    • .NET desktop development
    • Desktop development with C++
  • The Windows SDK version 2004 (build 19041) or later. This SDK will be installed with Visual Studio when you enable the UWP development workload.
  • The .NET 6 SDK. This SDK will be installed together with Visual Studio when you enable the .NET Framework desktop development workload.
  • The Visual Studio extension for the Windows App SDK (if you are using Visual Studio 2022 Update 1 or later, it will already be included).
The code for the chapter can be found at the following URL:
https://github.com/PacktPublishing/Modernizing-Your-Windows-Applications-with-the-Windows-Apps-SDK-and-WinUI/tree/main/Chapter01

A brief history of Windows UI platforms

Over the years, UI guidelines and paradigms have constantly shifted as hardware and platforms evolved. We moved from screens with 640 x 480 resolution to 4K or even 8K screens, from mouse and keyboard only to touch and digital pens. Consequently, Microsoft has created multiple UI platforms over time, with the goal of offering developers the opportunity to build modern applications; each of them represented the state of the art for the time when they were released.
The first platform was called Microsoft Foundation Class Library (MFC), which was a C++ object-oriented UI library released by Microsoft in 1992. It was a wrapper around most of the Win32 and Component Object Model (COM) APIs. Thanks to MFC, developers were able to build UIs with the most common Windows controls and build complex interfaces made up of multiple windows, panels, and so on. MFC was a considerable success, and it's still heavily used today by many developers. The following screenshot shows the look and feel of a typical MFC application:
Figure 1.1 – A Windows application that uses MFC as a UI framework
Figure 1.1 – A Windows application that uses MFC as a UI framework
However, as years passed by, it started to show limitations in supporting modern devices and features such as high-resolution screens and touch inputs. Additionally, it can be used only by C++ developers, while many developers over time have migrated to managed languages such as C#, which are easier to learn and support.
In 2002, Microsoft released the first version of .NET Framework with the goal of improving developer productivity. By running applications inside a virtual environment called Common Language Runtime (CLR), developers could get out-of-the-box features such as security, memory, and exception handling that, in the past, needed to be manually managed. Additionally, by introducing languages such as C# and VB.NET, Microsoft reduced the learning curve required to master a programming language and start building software. As part of .NET Framework, Microsoft included a platform to build Windows desktop applications called Windows Forms. It's an event-driven platform, which makes it easier to build complex applications by wrapping the existing Windows UI common controls and Windows APIs in managed code. The development experience is mostly UI-based – developers create UIs with a visual designer by dragging and dropping the available controls inside a window. Then, they can write code that reacts to the events exposed by the various controls, such as the click of a button or the selection of an item from a list. The following screenshot shows the development experience provided by Visual Studio to build Windows Forms applications:
 Figure 1.2 – The Windows Forms designer in Visual Studio
Figure 1.2 – The Windows Forms designer in Visual Studio
The platform kept evolving across the various releases of .NET Framework, until it reached full maturity with version 2.0.
With the release of .NET Core 3.0, Windows Forms has been integrated into the modern .NET development stack for the first time. This choice has enabled developers to access all the latest enhancements in the platform, such as newer versions of the C# language, performance improvements, or the latest Windows APIs. However, when it comes to building the UI, it still lacks many of the features you would expect from a modern platform, such as support for responsive layouts and new input experiences.
In 2006, as part of the release of .NET Framework 3.0, Microsoft unveiled Windows Presentation Foundation (WPF), the next evolution of the Microsoft UI platform. WPF introduced, for the first time, features that are still used today by modern UI platforms (including the Windows App SDK), such as XAML (which stands for Extensible Application Markup Language), binding, and dependency properties. WPF still supports building the UI with a designer, but it isn't as essential as it was for Windows Forms. WPF, in fact, decouples the UI from the business logic by describing the UI with XAML, an XML-based language. Additionally, WPF added support for features such as 2D/3D rendering, hardware acceleration, animations, and vector graphics. As with Windows Forms, .NET Core 3.0 welcomed WPF as a first-class citizen in...

Inhaltsverzeichnis