Table of Contents

Project Templates

The Eremex.Avalonia.Templates NuGet package contains a set of templates that help you quickly create new Avalonia UI projects with Eremex Controls.

Install the Eremex Avalonia Templates

Run the following command:

dotnet new install Eremex.Avalonia.Templates

Included Templates

eremex.avalonia.app

This application template creates an empty Avalonia UI project that references the Eremex Controls library. This template does the following:

  • Adds the Eremex Nuget packages to the project:

    • Eremex.Avalonia.Controls
    • Eremex.Avalonia.Themes.DeltaDesign
  • Uses the MxWindow class as the project's main window. The MxWindow window provides support for the Eremex paint themes.

  • Registers the Eremex DeltaDesign paint theme.

eremex.avalonia.mvvm

This application template creates an MVVM-aware Avalonia UI project that references the Eremex Controls library. The template separates the code into a View (MainWindow) and ViewModel (MainWindowViewModel). The rest of the features of this template are the same as the eremex.avalonia.app template.

eremex.avalonia.window

A template that creates a new MxWindow-based Avalonia window. This template only creates two files that define the window: Window.axaml and Window.axaml.cs.

Create a New Project from a Template Using a Command Line

Switch to the folder in which you need to create a project. Use the dotnet new template-name command to create a new project from the specified template. To define a name for the project, use the -n name command option.

The following command creates a new AvaloniaApplication1 project based on the eremex.avalonia.mvvm template.

dotnet new eremex.avalonia.mvvm -n AvaloniaApplication1

Open the created project in Visual Studio.