![]() |
VOOZH | about |
dotnet add package Forge.Forms.AvaloniaUI --version 1.0.3
NuGet\Install-Package Forge.Forms.AvaloniaUI -Version 1.0.3
<PackageReference Include="Forge.Forms.AvaloniaUI" Version="1.0.3" />
<PackageVersion Include="Forge.Forms.AvaloniaUI" Version="1.0.3" />Directory.Packages.props
<PackageReference Include="Forge.Forms.AvaloniaUI" />Project file
paket add Forge.Forms.AvaloniaUI --version 1.0.3
#r "nuget: Forge.Forms.AvaloniaUI, 1.0.3"
#:package Forge.Forms.AvaloniaUI@1.0.3
#addin nuget:?package=Forge.Forms.AvaloniaUI&version=1.0.3Install as a Cake Addin
#tool nuget:?package=Forge.Forms.AvaloniaUI&version=1.0.3Install as a Cake Tool
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.
| 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"/> |
| Type | Sub Types | Screenshot |
|---|---|---|
| String | String, Password, Multiline | |
| Numerical | <br/> | |
| Date | ||
| Time | ||
| Selection | <br/> | |
| Boolean | <br/> |
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.
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.
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 |
| 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 |
| 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" /> |
Import Project Forge.Forms.AvaloniaUI
For default style sheet, add this to App.axaml
<StyleInclude Source="avares://Forge.Forms.AvaloniaUI/Themes/Base.axaml" />
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}" />
If you only need to show windows and dialogs, use the Show helper:
using Forge.Forms;
await Show.Window().For(new Alert("Hello world!"));
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-browser1.0 net9.0-browser1.0 is compatible. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows7.0 net9.0-windows7.0 is compatible. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.