Uno Platform: An Overview of History, Microsoft Support, and Step-by-Step App Development


The Uno Platform is a versatile framework enabling developers to create cross-platform applications with a single codebase in C# and XAML. It’s built around compatibility with Universal Windows Platform (UWP) and WinUI, which allows developers to use Windows-native UI components and structures for multi-platform app development. This makes it ideal for extending apps designed for Windows to other platforms, including mobile and web.


Introduction to UWP and WinUI

UWP (Universal Windows Platform) is an application development platform created by Microsoft, designed to build apps that can run on various Windows devices, such as PCs, tablets, Xbox, and IoT devices. UWP apps use XAML for the UI, making it easy for developers to design modern and responsive applications while sharing resources and functionalities across the Windows ecosystem. UWP’s robust API allows developers to access device features like location, notifications, and sensors, providing a rich, interactive user experience.

WinUI (Windows UI Library) evolved from UWP and offers the latest advancements in native Windows UI development. Built as part of the Project Reunion initiative, WinUI brings a modern and flexible user interface that can be used not only within UWP but also across Win32 desktop applications. WinUI continues to advance the capabilities of the Windows UI by offering a broader, more modular library of components that can be adopted in multi-platform solutions.

Uno Platform leverages this strong foundation of UWP and WinUI, making it possible to reuse XAML-based UI code across platforms, such as iOS, Android, macOS, WebAssembly, and Linux. It essentially extends UWP and WinUI capabilities to the non-Windows world, supporting a single codebase to build native-like applications across platforms.


History of Uno Platform

Uno Platform was created by nventive, a Canadian technology firm, to bridge the gap in multi-platform development. It emerged to support developers who wanted to create applications for mobile (iOS and Android), desktop, and the web using their existing C# and XAML skills. By providing a single codebase that targets Windows, WebAssembly, Android, iOS, macOS, and Linux, Uno Platform quickly attracted developers seeking to expand their apps to multiple operating systems without needing to rewrite them from scratch. Uno’s cross-platform capabilities and compatibility with WinUI make it particularly popular among developers with experience in UWP or WPF.


Microsoft’s Support for Uno Platform

While Microsoft does not directly develop or manage Uno Platform, it has shown support for Uno’s mission. Uno is compatible with WinUI, which is Microsoft’s modern UI framework for Windows, and aligns well with the .NET ecosystem. This compatibility has led to an indirect partnership where Uno allows developers to extend the reach of Microsoft technologies across platforms beyond Windows. Uno Platform also integrates seamlessly with Visual Studio and supports .NET Standard, making it a robust choice for Microsoft-focused development teams looking to build multi-platform apps.


Building a Simple Uno Platform Application in Visual Studio 2022

In this section, we’ll walk through creating a simple Uno Platform app using Visual Studio 2022. The app will feature a button and a text box to display a “Hello, World!” message upon clicking.

Prerequisites

  • Visual Studio 2022 installed with Mobile development with .NET and Desktop development with .NET workloads.
  • Uno Platform Templates (these can be installed directly from Visual Studio’s extension manager).

Step-by-Step Guide

  1. Create a New Project:
  • Open Visual Studio 2022.
  • Go to File > New > Project.
  • Search for Uno Platform App and select Uno Platform App (WinUI). Click Next.
  1. Configure the Project:
  • Name your project (e.g., UnoHelloWorldApp).
  • Select the location where you want to save it.
  • Click Create to proceed.
  1. Set Up the Project Structure:
  • Once the project is created, Visual Studio will generate a cross-platform solution that includes several folders targeting iOS, Android, WebAssembly, and Windows.
  • In Solution Explorer, you’ll see projects for each platform, all sharing the same main logic codebase in the Shared project folder.
  1. Edit the MainPage.xaml:
  • In Solution Explorer, navigate to the Shared project, open MainPage.xaml.
  • Replace the default XAML with the following code to create a simple UI:
   <Page
       x:Class="UnoHelloWorldApp.MainPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:local="using:UnoHelloWorldApp">

       <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
           <TextBlock x:Name="HelloTextBlock" Text="Hello, Uno Platform!" FontSize="24" Margin="0,0,0,20"/>
           <Button Content="Click Me" Click="OnButtonClick"/>
       </StackPanel>
   </Page>
  1. Add Code-Behind Logic in MainPage.xaml.cs:
  • In MainPage.xaml.cs, add the following code to handle the button click event:
   using Windows.UI.Xaml.Controls;

   namespace UnoHelloWorldApp
   {
       public sealed partial class MainPage : Page
       {
           public MainPage()
           {
               this.InitializeComponent();
           }

           private void OnButtonClick(object sender, RoutedEventArgs e)
           {
               HelloTextBlock.Text = "Hello, World!";
           }
       }
   }
  1. Select a Target Platform and Run the App:
  • Uno Platform allows you to run the application on multiple targets, including Windows, WebAssembly, iOS, and Android.
  • In Visual Studio, use the Platform Selector dropdown to choose a platform (e.g., Windows or WebAssembly).
  • Click Start to build and run the application on your selected platform.

When the app runs, clicking the button should update the TextBlock to display “Hello, World!”.


Comparison Table: Uno Platform vs. WPF

FeatureUno PlatformWPF (Windows Presentation Foundation)
Platform SupportiOS, Android, Web (WebAssembly), Windows, macOS, LinuxWindows Only
UI FrameworkXAML (compatible with UWP/WinUI)XAML (specific to WPF)
Code SharingSingle codebase for multiple platformsPlatform-specific code
Microsoft SupportIndirect (supports WinUI/UWP APIs)Directly supported and maintained by Microsoft
Best forCross-platform apps using .NET/C# and WinUIWindows desktop applications with rich UI and MVVM
Development ToolsVisual Studio, RiderVisual Studio
Community and SupportGrowing community, actively developed by Uno and open-sourceEstablished community, with direct Microsoft support

Conclusion

The Uno Platform offers a powerful way to create multi-platform applications using familiar C# and XAML. By bridging the capabilities of WinUI with cross-platform targets like iOS, Android, and WebAssembly, Uno enables developers to reach broader audiences with minimal additional development effort. Although not officially maintained by Microsoft, Uno Platform enjoys strong compatibility with Microsoft tools and frameworks, making it a strong choice for developers who want to extend the reach of their applications across multiple platforms.

Edvaldo Guimrães Filho Avatar

Published by