dcsimg
September 27, 2020
Hot Topics:

Introduction to the UNO Platform

  • By Hannes DuPreez
  • Send Email »
  • More Articles »

UNO is a platform for building native mobile, desktop, and WebAssembly apps with C# and XAML from a single codebase. Sharing logic between platforms has always been relatively simple, but sharing user interfaces was not really possible. This meant that, with the help of Xamarin.Forms, you could have a similar look and feel on your Android and iOS devices, but not for the Web. This is where UNO is closing the gap. With UNO, you can write the UI once. With the use of native controls, UNO deploys the native UI look and feel to all the other platforms, meaning, you write the same code for a button regardless of the platform the button is for.

How Does It Work?

In UWP apps, UNO runs on top of UWP and the Windows UI. In Web apps, UNO makes use of the Web Assembly Bootstrapper that takes .NET Standard libraries to execute files in the JavaScript console. Mono ultimately executes the code. In mobile apps, UNO runs on top of the Xamarin Native Stack. Mono also executes the code.

Installing UNO

Use the next few steps to install the UNO Platform (see Figure 1).

  1. Select Extensions, Manage Extensions.
  2. In the search box, enter "uno platform". This will search the extensions.
  3. Select UNO Platform Solution Templates.
  4. Select Download.
  5. Restart Visual Studio.

Manage Extensions
Figure 1: Manage Extensions

Figure 2 shows the Extension being installed once Visual Studio was closed.

Installing
Figure 2: Installing

You also can download the Solution Templates from the Visual Studio Marketplace.

Two new project templates have been installed:

  • Cross-Platform Library (UNO Platform)
  • Cross-Platform App (UNO Platform)

They are shown in Figure 3.

Project Templates
Figure 3: Project Templates

  1. Select the Cross-Platform App template.
  2. Give it a name and a Location.
  3. Click Create.

There should be five projects in your Solution Explorer. They are:

  • Projectname.Droid
  • Projectname.iOS
  • Projectname.Shared
  • Projectname.UWP
  • Projectname.Wasm

If you encounter any errors while trying to create this project, it is due to the fact that some of your prerequisites are missing. Ensure you have the following Pre-Requisites installed as well:

  • Universal Windows Platform
  • Mobile development with .NET (Xamarin)
  • ASP.NET and Web workload
  • .NET Core 2.2

Conclusion

Exciting times are ahead. Luckily, Microsoft keeps introducing great new tools to help us develop better.






This article was originally published on April 9, 2020

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.


Thanks for your registration, follow us on our social networks to keep up-to-date