39,59 €
If 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.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 588
Veröffentlichungsjahr: 2022
Expand your desktop apps to support new features and deliver an integrated Windows 11 experience
Matteo Pagani
Marc Plogas
BIRMINGHAM—MUMBAI
Copyright © 2022 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Associate Publishing Product Manager: Sathyanarayanan Ellapulli
Senior Editor: Rohit Singh
Content Development Editor: Tiksha Lad
Technical Editor: Maran Fernandes
Copy Editor: Safis Editing
Project Coordinator: Manisha Singh
Proofreader: Safis Editing
Indexer: Subalakshmi Govindhan
Production Designer: Shyam Sundar Korumilli
Marketing Coordinator: Sonakshi Bubbar
First published: March 2022
Production reference: 1280322
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80323-566-0
www.packt.com
To my wife, Angela, for being a constant source of love, inspiration, and support. And to my daughter, Giulia, for teaching me to see the world from a different perspective.
– Matteo Pagani
Dedicated to anyone who still holds on to reason and scientific knowledge in today's turbulent times.
– Marc Plogas
Matteo Pagani is the lead of the Windows App Consult team in Microsoft. In his role, he supports developers and companies all around the world, enabling them to learn and adopt the latest development tools and technologies in the Microsoft 365 and .NET ecosystem. He has a strong passion for client development, which he loves to share with other developers by writing articles, blog posts, and books, and by speaking at conferences all around the world. Before joining Microsoft, he was a Microsoft MVP in the Windows Development category and a Nokia Developer Champion for almost 5 years.
I would like to thank my wife, Angela, and my daughter, Giulia, for their ongoing support and patience during the writing process. Next, I wish to thank my friend Marc for being a partner in crime. Then I would like to thank Sebastien Bovo and Xianghui Li for the excellent feedback they provided during the review process. Lastly, I would like to thank Microsoft and the App Consult team for supporting me on this journey.
Marc Plogas is an Azure AppConsult engineer at Microsoft and was on the Windows AppConsult team in his previous role. He works with start-ups and large companies on IoT, mixed reality, and software architecture. Tinkering with computers has always been his passion – since the tender age of 6. Therefore, he is interested in many development topics, including client development and machine learning, and enjoys all the challenges that can be solved with software engineering. Before joining Microsoft, Marc was a freelance software developer for many years, creating mobile and LoB applications.
First, I would like to thank my wife and daughter for their support, encouragement, and patience. I would also like to thank my friend Matteo, who covered my back more than once and encouraged me with memes and GIFs. I would also like to thank my team lead, David, who helped me free up time to work on the book. I would also like to thank my work-family at Microsoft, namely, both AppConsult teams, for the opportunity they have given me, especially my colleagues, Sebastien Bovo and Xianghui Li, for their feedback.
Sebastien Bovo has been a member of the worldwide Windows AppConsult team dedicated to the Windows Enterprise Developer product group at Microsoft. His everyday life involves helping customers, partners, and developers in creating Windows and holographic applications. He has worked on Proof of Concept, debugged code, and provided knowledge transfers and workshops for developers.
He loves sharing his experience and knowledge with others to make them better! In particular, he has been a speaker at technical conferences, including BUILD in Seattle, IGNITE in Orlando, and around Europe for the Windows Insider Dev Tour!
Sebastien has just assumed the role of cloud solution architect to help customers modernize and innovate with Microsoft Cloud.
Xianghui Li has solid solution analysis skills and extensive development experience in .NET, web solutions, and distributed systems. He has mastered Azure IaaS and PaaS, as well as IoT deployment, development, and troubleshooting. He is good at unmanaged/managed debugging and has successfully designed, developed, and released several debugging diagnostic tools in Global Azure and Microsoft Internal.
He now works as a Windows Application Consult in Microsoft, focusing on Microsoft 365, Windows development, and cutting-edge software techniques.
Windows desktop applications continue to play a critical role in many scenarios among consumers and enterprises. Many of them have been the outcome of very long development processes that involved technologies that are now outdated, hard to maintain, and hard to integrate with the latest Windows innovations.
In this book, we'll show how you can modernize the UI and the features of your application using the Windows App SDK and WinUI, the latest iteration of the Windows developer platform.
This book is for developers who are building Windows applications with Windows Forms, WPF, and UWP with a special focus on Line-of-Business (LoB) apps for enterprises. Basic knowledge of Windows app development, .NET/C#, and Visual Studio will assist with understanding the concepts covered in this book.
Chapter 1, Getting Started with the Windows App SDK and WinUI, covers the current status of the developer platform ecosystem and explains how you can start a new Windows App SDK project and how you can integrate its features into an existing Windows application.
Chapter 2, The Windows App SDK for a Windows Forms Developer, covers Windows Forms, which is one of the most popular development platforms for Windows. In this chapter, you'll learn how many concepts from Windows Forms are translated to the Windows App SDK and WinUI.
Chapter 3, The Windows App SDK for a WPF Developer, covers WPF, which has many similarities with the Windows App SDK and WinUI, starting from the shared UI layer based on XAML. In this chapter, you'll learn the key differences between WPF and WinUI.
Chapter 4, The Windows App SDK for a UWP Developer, explains that the Windows App SDK and WinUI are the direct successors to the UWP ecosystem. However, they are based on a different development model. In this chapter, we'll learn the differences we have to take into account.
Chapter 5, Designing Your Application, explains that building the UX of your application in the right way is critical to achieving success. This chapter will focus on important design elements, such as navigation, animations, and responsive layouts.
Chapter 6, Building a Future-Proof Architecture, explains that Windows desktop applications are often built to support critical tasks for many years to come. As such, building a future-proof architecture is critical to ensure you don't have to rebuild your application from scratch every time there's a requirement change. In this chapter, we'll learn how the MVVM pattern can help you build applications that are easy to maintain, test, and evolve over time.
Chapter 7, Migrating Your Windows Applications to the Windows App SDK and WinUI, puts into practice all the knowledge we acquired in the previous chapters to migrate existing Windows applications built with Windows Forms, WPF, and UWP to the Windows App SDK and WinUI.
Chapter 8, Integrating Your Application with the Windows Ecosystem, explains that Windows includes many innovative features that can be integrated into your application, such as Windows Hello and Geolocation. In this chapter, we'll learn how to use them in your Windows applications.
Chapter 9, Implementing Notifications, covers notifications, which play a key role in modern applications, delivering critical information to users. As such, Windows includes a powerful notification ecosystem, which you can integrate into your applications.
Chapter 10, Infusing Your Apps with Machine Learning Using WinML, explains that machine learning and artificial intelligence are two of the most important topics in the technology ecosystem. Windows enables developers to turn their machines into part of the edge ecosystem by supporting the evaluation of machine learning models without an internet connection and using the full power of the device. In this chapter, we'll learn how to integrate this platform, called WinML, into your Windows applications.
Chapter 11, Publishing Your Application, explains that developing a great application isn't enough to be successful. You have also to make it available to your users so that they can acquire it in the easiest possible way. In this chapter, we're going to explore the deployment opportunities offered by MSIX and platforms such as the Microsoft Store and App Installer.
Chapter 12, Enabling CI/CD for Your Windows Applications, covers DevOps, which is one of the key approaches nowadays to be successful in software development. In this chapter, we'll learn how you can use two of the key DevOps pillars, continuous integration and continuous deployment, to deliver your Windows applications in a more reliable, fast, and effective way.
To build Windows desktop applications with the Windows App SDK and WinUI, you will need the following:
To follow the last chapter of the book, you will need also a GitHub account.
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book's GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Modernizing-Your-Windows-Applications-with-the-Windows-Apps-SDK-and-WinUI. If there's an update to the code, it will be updated in the GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781803235660_ColorImages.pdf.
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "You must use this initialization code before setting the Source property in XAML or calling the EnsureCoreWebView2Async() method."
A block of code is set as follows:
<VariableSizedWrapGrid Orientation="Horizontal"
MaximumRowsOrColumns="3" ItemHeight="200" ItemWidth="200">
<Rectangle Fill="Red" />
<Rectangle Fill="Blue" />
<Rectangle Fill="Green" />
<Rectangle Fill="Yellow" />
</VariableSizedWrapGrid>
Any command-line input or output is written as follows:
winget install Microsoft.Edge
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: "Click on Upload files and wait for the process to finish."
Tips or important notes
Appear like this.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.
Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Once you've read Modernizing Your Windows Applications with the Windows App SDK and WinUI 3, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.
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