Skip to content

future2r/gelato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAUI on .NET Platform

Introduction

This is a template project for the development of a Windows desktop application:

  • .NET Platform
  • MAUI GUI Framework (Windows only, targeting WinUI 3)
  • Minimum OS: Windows 10 version 1809 (build 17763)

It is the companion project of

Prerequisites

Install VS Code:

winget install --id Microsoft.VisualStudioCode

Install the C# Dev Kit extension:

code --install-extension ms-dotnettools.csdevkit

Install the .NET platform:

winget install --id Microsoft.DotNet.SDK.10

Workspace

Open the workspace in VS Code:

File > Open Workspace from File... > Gelato.code-workspace

This workspace contains editor settings (format-on-save, organize-imports-on-save) and extension recommendations.

Three debug launch configurations are available (F5):

  • Gelato - Default locale
  • Gelato (English) - English locale
  • Gelato (German) - German locale

Build, Test and Run

Build the project:

dotnet build

Run the tests:

dotnet test

Run the application:

dotnet run --project Gelato.Gui/Gelato.Gui.csproj

Run the application with a specific language:

dotnet run --project Gelato.Gui/Gelato.Gui.csproj -- --lang=en-US
dotnet run --project Gelato.Gui/Gelato.Gui.csproj -- --lang=de-DE

Publish the application (including .NET):

dotnet publish Gelato.Gui/Gelato.Gui.csproj -c Release -r win-x64 --self-contained true
dotnet publish Gelato.Gui/Gelato.Gui.csproj -c Release -r win-arm64 --self-contained true

Find the deployable executable in:

Gelato.Gui/bin/Release/net10.0-windows10.0.19041.0/win-x64/publish
Gelato.Gui/bin/Release/net10.0-windows10.0.19041.0/win-arm64/publish

Project Structure

The project is organized as a .NET solution with three projects:

  • Gelato.Core/ - Core library with domain model (Variety) and in-memory database (Database)
  • Gelato.Gui/ - GUI application with MAUI views and MVVM view models
    • Resources/Strings/ - Localization via .resx files (English, German)
    • Resources/Images/ - Application icons
  • Gelato.Gui.Tests/ - Unit tests (xUnit, FluentAssertions)
  • Design/ - Design assets (ICO and PNG in various sizes)

The language can be overridden at startup with the --lang= argument (e.g. --lang=en-US, --lang=de-DE).

Project Setup

These steps document how the project was created from scratch.

Install MAUI workload:

dotnet workload install maui-windows

Create the solution:

dotnet new sln -n Gelato

Convert the solution to the XML-based format:

dotnet sln Gelato.sln migrate

Create the module projects:

dotnet new classlib -n Gelato.Core -f net10.0
dotnet new maui -n Gelato.Gui -f net10.0

Add module projects to the solution:

dotnet sln Gelato.slnx add Gelato.Core/Gelato.Core.csproj
dotnet sln Gelato.slnx add Gelato.Gui/Gelato.Gui.csproj

Add the reference to the Core to the Gui:

dotnet add Gelato.Gui/Gelato.Gui.csproj reference Gelato.Core/Gelato.Core.csproj

Test Project

Create the test project:

dotnet new xunit -n Gelato.Gui.Tests -f net10.0

Add the test project to the solution:

dotnet sln Gelato.slnx add Gelato.Gui.Tests/Gelato.Gui.Tests.csproj

Add the reference to the Gui to the Tests:

dotnet add Gelato.Gui.Tests/Gelato.Gui.Tests.csproj reference Gelato.Gui/Gelato.Gui.csproj

Add test dependencies:

dotnet add Gelato.Gui.Tests/Gelato.Gui.Tests.csproj package FluentAssertions

About

MAUI on .NET Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages