Discover how to leverage the Uno Platform to write single-codebase, cross-platform mobile, desktop, and web applications using C# and XAML

Key Features

  • Enhance your Windows apps by running them on all operating systems and browsers
  • Use tools and APIs you already know to remain productive as you target new platforms
  • Create realistic apps for various lines of business (LOBs) and consumer scenarios

Book Description

Developers are increasingly being asked to build native applications that run on multiple operating systems and in the browser. In the past, this would have meant learning new technologies and making multiple copies of an application. But the Uno Platform allows you to use tools, languages, and APIs you already know from building Windows apps to develop apps that can also run on other platforms. This book will help you to create customer-facing as well as line-of-business apps that can be used on the device, browser, or operating system of your choice.

This practical guide enables developers to put their C# and XAML knowledge to work by writing cross-platform apps using the Uno Platform. Packed with tips and practical examples, this book will help you to build applications for common scenarios. You'll begin by learning about the Uno Platform through step-by-step explanations of essential concepts, before moving on to creating cross-platform apps for different lines of business. Throughout this book, you'll work with examples that will teach you how to combine your existing knowledge to manage common development environments and implement frequently needed functionality.

By the end of this Uno development book, you will have learned how to write your own cross-platform apps with the Uno Platform and use additional tools and libraries to speed up your app development process.

What you will learn

  • Understand how and why Uno could be the right fit for your needs
  • Set up your development environment for cross-platform app development with the Uno Platform and create your first Uno Platform app
  • Find out how to create apps for different business scenarios
  • Discover how to combine technologies and controls to accelerate development
  • Go beyond the basics and create 'world-ready' applications
  • Gain the confidence and experience to use Uno in your own projects

Who this book is for

This book is for developers who are familiar with app development for Windows and want to use their existing skills to build cross-platform apps. Basic knowledge of C# and XAML is required to get started with this book. Anyone with basic experience in app development using WPF, UWP, or WinUI will be able to learn how to create cross-platform applications with the Uno Platform.

Table of Contents

  1. Creating Cross-Platform C# Applications with Uno Platform
  2. Contributors
  3. About the authors
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Code in Action
    6. Download the color images
    7. Conventions used
    8. Get in touch
    9. Share Your Thoughts
  6. Section 1: Getting to Know Uno Platform
  7. Chapter 1: Introducing Uno Platform
    1. Technical requirements
    2. Understanding what Uno Platform is
    3. A brief history of Uno Platform
    4. How Uno Platform works
    5. Is it a panacea?
    6. Using Uno Platform
    7. Uno Platform allows you to use what you already know
    8. Uno Platform supports many platforms
    9. Can Uno Platform do everything that your app requires?
    10. How does Uno Platform compare to the alternatives?
    11. Setting up your development environment
    12. Developing with Visual Studio
    13. Using other editors and IDEs
    14. Checking your setup
    15. Debugging your setup
    16. Summary
    17. Further reading
  8. Chapter 2: Writing Your First Uno Platform App
    1. Technical requirements
    2. Creating your first app
    3. Creating your project with the Uno Platform solution templates
    4. Creating your project with the .NET CLI
    5. Project structure and the heads
    6. Building and running your first Uno Platform app
    7. Running and debugging your app with Visual Studio on Windows
    8. Running and debugging your apps with Visual Studio for Mac
    9. Debugging the WASM head of your app
    10. XAML Hot Reload and C# Edit and Continue
    11. Platform-specific XAML and C#
    12. Platform-specific C#
    13. Platform-specific XAML
    14. Going beyond the default cross-platform app structure
    15. The multi-platform library project type
    16. Other project types
    17. Summary
  9. Section 2: Writing and Developing Uno Platform Apps
  10. Chapter 3: Working with Forms and Data
    1. Technical requirements
    2. Introducing the app
    3. Creating the app
    4. Entering and validating data
    5. Using Windows Community Toolkit controls
    6. Displaying data using DataGrid
    7. Displaying data with the DataGrid control
    8. Exporting issues in PDF format
    9. Exporting on desktop
    10. Exporting on the web with a download link
    11. Summary
  11. Chapter 4: Mobilizing Your App
    1. Technical requirements
    2. Introducing the app
    3. Creating the app
    4. Creating the main page
    5. Showing upcoming arrival details
    6. Retrieving remote data
    7. Connecting to a remote data source
    8. Using Polly to handle exceptions and retry requests
    9. Making your app look like it belongs on each platform
    10. Applying Material styles to the Android version of the app
    11. Applying Cupertino styles to the iOS version of the app
    12. Accessing device capabilities
    13. Summary
  12. Chapter 5: Making Your App Ready for the Real World
    1. Technical requirements
    2. Introducing the app
    3. Creating the app
    4. Creating the main navigation and booking process
    5. Persisting data locally using the ApplicationData API and SQLite
    6. Storing data using the ApplicationData API
    7. Using SQLite to store data
    8. Loading data from SQLite
    9. Making your app ready for customers
    10. Localizing your app
    11. Customizing your app's appearance
    12. Ensuring everyone can use your app
    13. Summary
  13. Chapter 6: Displaying Data in Charts and with Custom 2D Graphics
    1. Technical requirements
    2. Introducing the app
    3. Creating the app
    4. Creating the individual pages
    5. Creating the main page
    6. Displaying charts with controls from SyncFusion
    7. Updating references to include the SyncFusion controls
    8. Drawing a line chart
    9. Displaying charts with controls from Infragistics
    10. Updating references
    11. Drawing a column chart
    12. Drawing custom graphics with SkiaSharp
    13. Updating project references
    14. Drawing the network map
    15. Responding to changes in the UI
    16. Changing the page layout
    17. Stretching and scaling content to fit the available space
    18. Summary
  14. Section 3: Test, Deploy, and Contribute
  15. Chapter 7: Testing Your Apps
    1. Technical requirements
    2. Getting started with Uno.UITest
    3. Writing and running your first test
    4. How Uno.UITest works
    5. Authoring your first test
    6. Running your tests on Android, iOS, and WASM
    7. Writing more complex tests
    8. Test tools beside Uno.UITest
    9. Testing the UWP head of your app with WinAppDriver
    10. Writing unit tests for your Uno Platform app
    11. Performing manual testing and why it is important
    12. Summary
  16. Chapter 8: Deploying Your Apps and Going Further
    1. Technical requirements
    2. Bringing Xamarin.Forms apps to WebAssembly
    3. Deploying a Wasm Uno Platform app to the web
    4. Automating build, tests, and distribution
    5. Deploying your app to a store
    6. Engaging with the Uno Platform community
    7. Sources of information
    8. Sources of help
    9. Contributing
    10. Summary
    11. Why subscribe?
  17. Other Books You May Enjoy
    1. Packt is searching for authors like you