Forge.Forms.AvaloniaUI 1.0.3

dotnet add package Forge.Forms.AvaloniaUI --version 1.0.3
                    
NuGet\Install-Package Forge.Forms.AvaloniaUI -Version 1.0.3
                    
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="Forge.Forms.AvaloniaUI" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Forge.Forms.AvaloniaUI" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Forge.Forms.AvaloniaUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Forge.Forms.AvaloniaUI --version 1.0.3
                    
#r "nuget: Forge.Forms.AvaloniaUI, 1.0.3"
                    
#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.
#:package Forge.Forms.AvaloniaUI@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Forge.Forms.AvaloniaUI&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Forge.Forms.AvaloniaUI&version=1.0.3
                    
Install as a Cake Tool

Forge.Forms.AvaloniaUI

NuGet

📖 About

With Forge.Forms you can create dynamic forms in WPF from classes or XML. Using this library is straightforward. DynamicForm is a control that will render controls bound to an associated model. A model can be an object, a type, a primitive, or a custom IFormDefinition.

Given the flexibility it provides especially in MVVM based applications, Sachith Liyanagama, is currently porting the project into the * Avalonia framework*.

To get started, check out the original guide for now. Avalonia-Specific guide will be documented later. or follow the installation instructions below.

📷 Screenshots

Cross Platform User Interface (Demo Project)

Desktop WASM
<img src="https://github.com/user-attachments/assets/b65363fd-c91a-4a28-9518-2a73703f5b36" title="Avalonia Desktop App" width="400"/> <img src="https://github.com/user-attachments/assets/c773e661-8458-4755-9d65-17a10c738609" title="Avalonia Webassembly App (WASM)" width="400"/>

Data Types & Control Components

Type Sub Types Screenshot
String String, Password, Multiline image
Numerical Numeric Up Down<br/>Slider
Date image
Time image
Selection Radio Buttons<br/> Editable Combobox
Boolean Toggle Switch<br/> Checkbox

⚠️ Warning

Due to the original WPF-Based library ships with dependencies to UI toolkits such as Material Design, there can be certain bottlenecks. Please consider this project/repository to be experimental until a better and cleaner approach has been developed.

🚀 Avalonia PORTING Log

Due to the complex usage of deferred bindings in the original project, porting to avalonia is done incermentally. Similarly based on the functionality the components are classified as follows.

Control Components

First iteration of the controls are ported using basic Fluent Theme styling and later need to be ported to CONTROL THEMES.

Control Type Status Comment
Action Element 🎌 Ported
Boolean Field 🎌 Ported
Break Element 🎌 Ported
Card Element 🎌 Ported Dependency to Card Component of Material Design, need to work on sizing.
Converted Field 🎌 Ported Need to test more
Date Field 🎌 Ported Must use DateTimeOffset for the bound properties instead of DateTime
Time Field 🎌 Ported Avalonia Returns DateTime offset. Need to change the Resource type
Divider Element 🎌 Ported
Error Text Element 💤 Will be removed Do not needed.
Heading Element 🎌 Ported
Image Element 🎌 Ported Need to copy image to the "Assets" folder and write path in the format of: [Image("avares://(AssemblyName)/Assets/(filename)")]
Selection Field 🎌 Ported Dynamic Binding not available due to Binding Incompatibilities
Slider Field 🎌 Ported
Text Element 🎌 Ported WASM seems to not handle the MultiBinding Strings.
Title Element 🎌 Ported
Toggle Field 🎌 Ported

Logical Components

Logic Status Comment
Form Builder 🎌 Ported Need more testing
XML Form Builder 🎌 Ported Need more testing. Bindings seems not to work.
Attributes 🎌 Ported Mostly working, other than dynamic property bindings for Selection.
Form Binding Extension 🎌 Recreated Given that the DataContext setting is not set mostly during initialization, had to optimize logic and seperate certain Bindings to use a converter (FormBindingConverter).
Freezable Proxy Objects 🎌 Ported Replaced Ifreezable with avalonia object and pass binding from control.
Dialogs 🎌 Ported Need more testing and style optimization. Window needs to be optimized.
File Binding 💤 Incomplete FileWatcher only works on Desktop. Need to find an alternative.
Data Validation 🎌 Recreated Rewrote the validation logic in a simple manner using a model wrapper, Validation event and DataValidationErrors

Themes

Framework Method Status How to Use
Avalonia - Fluent Styles & Control Theme Currently being optimized xaml <StyleInclude Source="avares://Forge.Forms.AvaloniaUI/Themes/Fluent.axaml" />
Material Styles & Control Theme Currently being optimized xaml <StyleInclude Source="avares://Forge.Forms.AvaloniaUI/Themes/Material.axaml" />

Installation

Import Project Forge.Forms.AvaloniaUI

For default style sheet, add this to App.axaml

<StyleInclude Source="avares://Forge.Forms.AvaloniaUI/Themes/Base.axaml" />

DynamicForm control

If you want to use DynamicForm, import this namespace in XAML:


<xmlns:forms="clr-namespace:Forge.Forms.AvaloniaUI.Controls;assembly=Forge.Forms"/>

And use the control:

<forms:DynamicForm Model="{Binding Model}" />

Displaying Windows

If you only need to show windows and dialogs, use the Show helper:

using Forge.Forms;

await Show.Window().For(new Alert("Hello world!"));

Displaying Dialogs 🚧

using Forge.Forms;

await Show.Dialog().For<Login>(); 

Note: if you are using Show.Dialog() without specifying a dialog identifier, it expects you to have a DialogHost in your XAML tree.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-browser1.0 is compatible.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.0.3 176 6/8/2025
1.0.2 109 1/4/2025
1.0.1 86 12/25/2024
1.0.0 78 12/24/2024