Book Image

Creating Cross-Platform C# Applications with Uno Platform

By : Matt Lacey, Marcel Alexander Wagner
Book Image

Creating Cross-Platform C# Applications with Uno Platform

By: Matt Lacey, Marcel Alexander Wagner

Overview of this book

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.
Table of Contents (13 chapters)
1
Section 1: Getting to Know Uno Platform
4
Section 2: Writing and Developing Uno Platform Apps
9
Section 3: Test, Deploy, and Contribute

Exporting issues in PDF format

In addition to being able to view data inside a line of business app, often, it is desired to be able to be export data, for example, as a PDF, so that you can print it or send it via email. For this, we will write an interface that allows users to export a given issue to PDF. Since there are no built-in APIs for this, we will use the iText library for this. Note that if you want to use the library in your application, you either need to follow the AGPL license or buy a commercial license for the library. However, before we can write the code to generate the PDF, we will need to prepare the project:

  1. First, we need to install the iText NuGet package. For this, right-click the solution and search for iText. Select the package. Then, from the project list, select the macOS, UWP, and WASM heads and click Install.
  2. Now, create a class named ExportIssueViewModel.cs inside the ViewModels folder with the following code:
    using iText.Kernel.Pdf;
    using...