Mattias1.AvaloniaExtensions 1.7.0

dotnet add package Mattias1.AvaloniaExtensions --version 1.7.0
NuGet\Install-Package Mattias1.AvaloniaExtensions -Version 1.7.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mattias1.AvaloniaExtensions" Version="1.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mattias1.AvaloniaExtensions --version 1.7.0
#r "nuget: Mattias1.AvaloniaExtensions, 1.7.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mattias1.AvaloniaExtensions as a Cake Addin
#addin nuget:?package=Mattias1.AvaloniaExtensions&version=1.7.0

// Install Mattias1.AvaloniaExtensions as a Cake Tool
#tool nuget:?package=Mattias1.AvaloniaExtensions&version=1.7.0

Avalonia Extensions

Some extensions to quickly build Avalonia UI desktop applications without needing XAML. Built on top of Avalonia.Markup.Declarative.

Note that while using these extensions allow you to very quickly setup an application, they do somewhat push you into using Avalonia UI my way, rather than extending Avalonia UI generically.

NuGet packages

You can install the avalonia extensions via the NuGet package Mattias1.AvaloniaExtensions.

Example

This is a simple example application:

using AvaloniaExtensions;

AvaloniaExtensionsApp.Init().StartDesktopApp("Example app", () => new ReadmeComponent());

public class ReadmeComponent : CanvasComponentBase {
  protected override void InitializeControls() {
    AddTextBlock("A simple example application").TopLeftInPanel();
    AddButton("Cancel").BottomRightInPanel();
    AddButton("Ok").LeftOf();
  }
}

For a more elaborate example, you can take a look at the Example App source.

Setup development environment

  • Clone the Avalonia.Markup.Declarative repo in the 'lib' folder
  • Copy the needed files to the 'AvaloniaExtensions/lib/Avalonia.Markup.Declarative' folder with
    mkdir -p AvaloniaExtensions/lib/Avalonia.Markup.Declarative/
    cd lib/Avalonia.Markup.Declarative/src/Avalonia.Markup.Declarative/
    cp -r --parents *.cs ../../../../AvaloniaExtensions/lib/Avalonia.Markup.Declarative/
    cp -r --parents **/*.cs ../../../../AvaloniaExtensions/lib/Avalonia.Markup.Declarative/
    cd ../../../../
    
  • Start the example app with cd ExampleApp/ && dotnet run

Publish release

Create a github release with a tag named 'vx.y.z'.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.7.0 100 5/5/2024
1.6.0 97 3/30/2024
1.5.0 230 10/25/2023
1.4.0 122 9/8/2023
1.3.0 110 9/4/2023
1.2.1 119 9/4/2023
1.2.0 107 9/3/2023
1.1.0 109 9/3/2023
1.0.0 100 8/31/2023
0.2.0 121 8/28/2023
0.1.1 119 8/17/2023
0.1.0 120 8/15/2023