In my previous post on Creating Cross-Platform/Multi-Platform .NET Applications with Windows App SDK (WinUI) and the Uno Platform, I gave a quick introduction to the Visual Studio wizard for creating an Uno Platform application. In this post we’re going to look at using the Default (or recommended) preset configuration and an overview of some of the options available to customize the creation of your application. By the way, if you’re just targeting Windows, you can use this wizard to jump start your Windows App SDK (WinUI) base application.
Ok, so we’re going to start by creating a new application using the Visual Studio Uno Platform wizard (you can grab the Uno Platform Visual Studio Extension to install this wizard). This time, we’re going to select the Default preset configuration.
We’re going to stick with the options set by the Default configuration but we’ll click on the Customize button to take a look at how the template can be customized.
When you get into the customization screen there are a couple of things to note. On the left is the navigation pane, allowing you to jump to any section – you don’t need to visit every section if you already know which section you want to adjust.
At the bottom of the screen there are buttons to Cancel (i.e. exit back to the screen where you can pick one of the preset configurations), Next/Back (to step to the next or previous section) and Create to proceed with the selected configuration and create the application.
On the right is a summary of the current configuration. If you’re curious about one of the values you can click on it to jump to that section.
Lastly, in the centre of the screen are the available options for the currently selected section. Let’s take a quick look at each of the sections (current at time of writing).
Pick the .NET framework version you want your application to start with. This defaults to .NET 7 which is the most recent release but you can switch to .NET 6 (for an LTS version) or step forward to .NET 8 if you’re interested in trying out the next version.
This defaults to include the mobile platforms (iOS, Android), desktop (MacCatalyst, Windows and GTK) and web (WASM) but you can also pick WPF or uncheck platforms you don’t want
If you’re familiar with XAML you may want to switch to using MVVM but I would encourage you to try out MVUX and provide feedback to its ongoing development.
The Server project is an ASP.NET Core project that can be used to host the WASM application and provide backend API for your application.
There are two testing projects that allow for the creation of unit tests and UI tests.
There are a couple of WASM specific features for files required for VS Code debugging and PWA.
The Uno.Extensions provide a number of capabilities that makes building applications easier. This leverages the Microsoft.Extensions base packages and provides additional features specific to building multi-platform applications.
You can specify the Application Id which is used to set things like the Bundle Id for iOS.
Lastly, you can switch between Material and Fluent themes for your application.
Let’s hit the Create button and take a look at the application that gets created.
If you compare this solution, to the solution that was created using the Blank preset configuration (see previous post for comparison), you’ll notice that there are additional projects: Server (for hosting WASM app and backend APIs), Tests and UITests (for testing) and DataContracts (for types shared between Server and client applications).
Inside the main class library (i.e. UnoApp2) you’ll see that there are folders that hold different components of the application. Here we’ve expanded Presentation to show two pages (MainPage and SecondPage) and a Shell control (host for Uno.Navigation and the root of the application content). This folder also holds the corresponding model classes – we’re using MVUX here, so we refer to these types as models because they’re immutable, rather than view models for MVVM.
We’ll wrap up by running the Windows application
2 thoughts on “Exploring the Uno Platform Visual Studio Wizard for Creating Apps for the Windows App SDK (WinUI), iOS, Android, Mac, Linux and Web”