Skip to content

nventive/UnoApplicationTemplate

Repository files navigation

Uno Platform Application Template

License Version Downloads

This is a mobile app project template using Uno Platform and the latest .NET practices.

Preview

From left to right: WinUI, iOS, and Android. Platform-Comparison-Preview

Note that scaling was adjusted to better fit this preview and therefore this image isn't representative of the actual device sizes.

Diagnostic Tools

Diagnostics-Overlay-Preview

Requirements

Visual Studio 2022 with .NET 8 are required.

This template largely relies on Uno Platform, if you want to make sure you got everything installed correctly on your machine, we encourage you to use uno-check, the documentation is available here

💡 It's also possible to use this template for a pure WinUI application, without any mobile aspect. All you would have to do is remove the .Mobile csproj from the generated solution.

Getting Started

We use dotnet project templates to easily create new projects. It simplifies the project renaming and supports conditional inclusions.

Generate a new project

  1. Install the template using this command.

    dotnet new install NV.Templates.Mobile

  2. To run the template and create a new project, run the following command in the folder that will contain the new project.

    dotnet new nv-mobile -n MyProjectName

    ⚠ The use of periods (.) in the project name is not supported and may result in compilation issues later on.

    💡 If all your projects are regrouped in a folder like C:\Repos, you want to be in that folder. The command would generate all the project files under C:\Repos\MyProjectName.

    The following options are available when running the command.

    • To get help: dotnet new nv-mobile -h

Next Steps

  1. Open the README.md and complete the documentation TODOs.

  2. Open the solution file from the generated folder using Visual Studio.

    It's located at MyProjectName/src/MyProjectName.sln.

  3. In Visual Studio, go to the VIEW menu and open the Task List to get hints on next steps.

    This template comes with several pointers on what you're most likely to change next.

Architecture and Recipes

This repository provides documentation on different topics under the doc folder.

Architecture

The software architecture of the application is documented in the Architecture document.

Summary of Recipes

Topic Recipe/Implementation
UI Framework WinUI
Uno Platform
MVVM Chinook.DynamicMvvm
Dependency Injection Microsoft.Extensions.Hosting
Microsoft.Extensions.DependencyInjection
Configuration Microsoft.Extensions.Configuration
Runtime Environments Microsoft.Extensions.Configuration
Design System Uno.Material
Material Design
HTTP Refit
Microsoft.Extensions.Http
Async Data Loading Chinook.DataLoader
Logging Serilog
Microsoft.Extensions.Logging
Testing xUnit
Serialization System.Text.Json
Localization Microsoft.Extensions.Localization
Navigation Chinook.Navigation
Chinook.BackButtonManager
Validation FluentValidation
App Reviews ReviewService

Debugging or Testing the Template

Here's how to install the template directly from the code, in the case that you want to modify it and would like to test your changes.

Installing the template

  1. Uninstall the template from nuget.org (if applicable).

    • dotnet new uninstall NV.Templates.Mobile
  2. Clone this repository on your machine.

  3. Open a command prompt at the root of the cloned repository.

  4. Run the following command.

    • dotnet new install ./

Read this for more information on custom templates.

Uninstalling the template

  1. Open a command prompt at the root of the cloned repository.

  2. Run the following command.

    • dotnet new uninstall ./

Changelog

Please consult the CHANGELOG for more information about the version history.

License

This project is licensed under the Apache 2.0 license. See the LICENSE for details.

Contributing

Please read CONTRIBUTING for details on the process for contributing to this project.

Be mindful of our Code of Conduct.